diff options
Diffstat (limited to 'www/chromium-uc/patches/core')
39 files changed, 12872 insertions, 0 deletions
diff --git a/www/chromium-uc/patches/core/bromite/disable-fetching-field-trials.patch b/www/chromium-uc/patches/core/bromite/disable-fetching-field-trials.patch new file mode 100644 index 0000000..ebb9aec --- /dev/null +++ b/www/chromium-uc/patches/core/bromite/disable-fetching-field-trials.patch | |||
| @@ -0,0 +1,88 @@ | |||
| 1 | # NOTE: Modified to remove usage of compiler #if macros | ||
| 2 | From: csagan5 <32685696+csagan5@users.noreply.github.com> | ||
| 3 | Date: Sun, 8 Jul 2018 18:16:34 +0200 | ||
| 4 | Subject: Disable fetching of all field trials | ||
| 5 | |||
| 6 | --- | ||
| 7 | .../browser/flags/ChromeFeatureList.java | 19 ++++--------------- | ||
| 8 | .../variations/service/variations_service.cc | 12 +----------- | ||
| 9 | 2 files changed, 5 insertions(+), 26 deletions(-) | ||
| 10 | |||
| 11 | --- chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java.orig | ||
| 12 | +++ chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java | ||
| 13 | @@ -105,11 +105,7 @@ public abstract class ChromeFeatureList | ||
| 14 | * the specified parameter does not exist. | ||
| 15 | */ | ||
| 16 | public static String getFieldTrialParamByFeature(String featureName, String paramName) { | ||
| 17 | - String testValue = FeatureList.getTestValueForFieldTrialParam(featureName, paramName); | ||
| 18 | - if (testValue != null) return testValue; | ||
| 19 | - if (FeatureList.hasTestFeatures()) return ""; | ||
| 20 | - assert FeatureList.isInitialized(); | ||
| 21 | - return ChromeFeatureListJni.get().getFieldTrialParamByFeature(featureName, paramName); | ||
| 22 | + return ""; | ||
| 23 | } | ||
| 24 | |||
| 25 | /** | ||
| 26 | @@ -126,12 +122,7 @@ public abstract class ChromeFeatureList | ||
| 27 | */ | ||
| 28 | public static int getFieldTrialParamByFeatureAsInt( | ||
| 29 | String featureName, String paramName, int defaultValue) { | ||
| 30 | - String testValue = FeatureList.getTestValueForFieldTrialParam(featureName, paramName); | ||
| 31 | - if (testValue != null) return Integer.valueOf(testValue); | ||
| 32 | - if (FeatureList.hasTestFeatures()) return defaultValue; | ||
| 33 | - assert FeatureList.isInitialized(); | ||
| 34 | - return ChromeFeatureListJni.get().getFieldTrialParamByFeatureAsInt( | ||
| 35 | - featureName, paramName, defaultValue); | ||
| 36 | + return defaultValue; | ||
| 37 | } | ||
| 38 | |||
| 39 | /** | ||
| 40 | @@ -148,12 +139,7 @@ public abstract class ChromeFeatureList | ||
| 41 | */ | ||
| 42 | public static double getFieldTrialParamByFeatureAsDouble( | ||
| 43 | String featureName, String paramName, double defaultValue) { | ||
| 44 | - String testValue = FeatureList.getTestValueForFieldTrialParam(featureName, paramName); | ||
| 45 | - if (testValue != null) return Double.valueOf(testValue); | ||
| 46 | - if (FeatureList.hasTestFeatures()) return defaultValue; | ||
| 47 | - assert FeatureList.isInitialized(); | ||
| 48 | - return ChromeFeatureListJni.get().getFieldTrialParamByFeatureAsDouble( | ||
| 49 | - featureName, paramName, defaultValue); | ||
| 50 | + return defaultValue; | ||
| 51 | } | ||
| 52 | |||
| 53 | /** | ||
| 54 | @@ -184,12 +170,7 @@ public abstract class ChromeFeatureList | ||
| 55 | */ | ||
| 56 | public static boolean getFieldTrialParamByFeatureAsBoolean( | ||
| 57 | String featureName, String paramName, boolean defaultValue) { | ||
| 58 | - String testValue = FeatureList.getTestValueForFieldTrialParam(featureName, paramName); | ||
| 59 | - if (testValue != null) return Boolean.valueOf(testValue); | ||
| 60 | - if (FeatureList.hasTestFeatures()) return defaultValue; | ||
| 61 | - assert FeatureList.isInitialized(); | ||
| 62 | - return ChromeFeatureListJni.get().getFieldTrialParamByFeatureAsBoolean( | ||
| 63 | - featureName, paramName, defaultValue); | ||
| 64 | + return defaultValue; | ||
| 65 | } | ||
| 66 | |||
| 67 | /* Alphabetical: */ | ||
| 68 | --- components/variations/service/variations_service.cc.orig | ||
| 69 | +++ components/variations/service/variations_service.cc | ||
| 70 | @@ -238,17 +238,7 @@ bool GetInstanceManipulations(const net: | ||
| 71 | // Variations seed fetching is only enabled in official Chrome builds, if a URL | ||
| 72 | // is specified on the command line, and for testing. | ||
| 73 | bool IsFetchingEnabled() { | ||
| 74 | -#if !BUILDFLAG(GOOGLE_CHROME_BRANDING) | ||
| 75 | - if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | ||
| 76 | - switches::kVariationsServerURL) && | ||
| 77 | - !g_should_fetch_for_testing) { | ||
| 78 | - DVLOG(1) | ||
| 79 | - << "Not performing repeated fetching in unofficial build without --" | ||
| 80 | - << switches::kVariationsServerURL << " specified."; | ||
| 81 | - return false; | ||
| 82 | - } | ||
| 83 | -#endif | ||
| 84 | - return true; | ||
| 85 | + return false; | ||
| 86 | } | ||
| 87 | |||
| 88 | std::unique_ptr<SeedResponse> MaybeImportFirstRunSeed( | ||
diff --git a/www/chromium-uc/patches/core/debian/disable/unrar.patch b/www/chromium-uc/patches/core/debian/disable/unrar.patch new file mode 100644 index 0000000..a87c2a8 --- /dev/null +++ b/www/chromium-uc/patches/core/debian/disable/unrar.patch | |||
| @@ -0,0 +1,85 @@ | |||
| 1 | description: disable support for safe browsing inspection of rar files | ||
| 2 | author: Michael Gilbert <mgilbert@debian.org> | ||
| 3 | bug: http://bugs.debian.org/914487 | ||
| 4 | |||
| 5 | --- chrome/browser/safe_browsing/download_protection/file_analyzer.cc.orig | ||
| 6 | +++ chrome/browser/safe_browsing/download_protection/file_analyzer.cc | ||
| 7 | @@ -95,7 +95,7 @@ void FileAnalyzer::Start(const base::Fil | ||
| 8 | if (inspection_type == DownloadFileType::ZIP) { | ||
| 9 | StartExtractZipFeatures(); | ||
| 10 | } else if (inspection_type == DownloadFileType::RAR) { | ||
| 11 | - StartExtractRarFeatures(); | ||
| 12 | + LOG(WARNING) << "Safebrowser inspection of rar files is disabled in this build"; | ||
| 13 | #if defined(OS_MAC) | ||
| 14 | } else if (inspection_type == DownloadFileType::DMG) { | ||
| 15 | StartExtractDmgFeatures(); | ||
| 16 | --- chrome/common/safe_browsing/BUILD.gn.orig | ||
| 17 | +++ chrome/common/safe_browsing/BUILD.gn | ||
| 18 | @@ -58,39 +58,6 @@ if (safe_browsing_mode == 1) { | ||
| 19 | public_deps = [ "//components/safe_browsing/core/common/proto:csd_proto" ] | ||
| 20 | } | ||
| 21 | |||
| 22 | - source_set("rar_analyzer") { | ||
| 23 | - sources = [ | ||
| 24 | - "rar_analyzer.cc", | ||
| 25 | - "rar_analyzer.h", | ||
| 26 | - ] | ||
| 27 | - | ||
| 28 | - deps = [ | ||
| 29 | - ":archive_analyzer_results", | ||
| 30 | - ":download_type_util", | ||
| 31 | - "//base", | ||
| 32 | - "//base:i18n", | ||
| 33 | - "//components/safe_browsing/content/common:file_type_policies", | ||
| 34 | - "//components/safe_browsing/core/common", | ||
| 35 | - "//third_party/unrar:unrar", | ||
| 36 | - ] | ||
| 37 | - | ||
| 38 | - defines = [ | ||
| 39 | - "_FILE_OFFSET_BITS=64", | ||
| 40 | - "LARGEFILE_SOURCE", | ||
| 41 | - "RAR_SMP", | ||
| 42 | - "SILENT", | ||
| 43 | - | ||
| 44 | - # The following is set to disable certain macro definitions in the unrar | ||
| 45 | - # source code. | ||
| 46 | - "CHROMIUM_UNRAR", | ||
| 47 | - | ||
| 48 | - # Disables exceptions in unrar, replaces them with process termination. | ||
| 49 | - "UNRAR_NO_EXCEPTIONS", | ||
| 50 | - ] | ||
| 51 | - | ||
| 52 | - public_deps = [ "//components/safe_browsing/core/common/proto:csd_proto" ] | ||
| 53 | - } | ||
| 54 | - | ||
| 55 | if (is_linux || is_win) { | ||
| 56 | source_set("document_analyzer") { | ||
| 57 | sources = [ | ||
| 58 | @@ -189,7 +156,6 @@ source_set("safe_browsing") { | ||
| 59 | ":archive_analyzer_results", | ||
| 60 | ":binary_feature_extractor", | ||
| 61 | ":download_type_util", | ||
| 62 | - ":rar_analyzer", | ||
| 63 | "//components/safe_browsing/core/common", | ||
| 64 | ] | ||
| 65 | |||
| 66 | --- chrome/services/file_util/safe_archive_analyzer.cc.orig | ||
| 67 | +++ chrome/services/file_util/safe_archive_analyzer.cc | ||
| 68 | @@ -7,7 +7,6 @@ | ||
| 69 | #include "base/macros.h" | ||
| 70 | #include "build/build_config.h" | ||
| 71 | #include "chrome/common/safe_browsing/archive_analyzer_results.h" | ||
| 72 | -#include "chrome/common/safe_browsing/rar_analyzer.h" | ||
| 73 | #include "chrome/common/safe_browsing/zip_analyzer.h" | ||
| 74 | |||
| 75 | #if defined(OS_MAC) | ||
| 76 | @@ -47,8 +46,7 @@ void SafeArchiveAnalyzer::AnalyzeRarFile | ||
| 77 | AnalyzeRarFileCallback callback) { | ||
| 78 | DCHECK(rar_file.IsValid()); | ||
| 79 | |||
| 80 | + LOG(FATAL) << "AnalyzeRarFile is disabled in this build"; | ||
| 81 | safe_browsing::ArchiveAnalyzerResults results; | ||
| 82 | - safe_browsing::rar_analyzer::AnalyzeRarFile( | ||
| 83 | - std::move(rar_file), std::move(temporary_file), &results); | ||
| 84 | std::move(callback).Run(results); | ||
| 85 | } | ||
diff --git a/www/chromium-uc/patches/core/inox-patchset/0001-fix-building-without-safebrowsing.patch b/www/chromium-uc/patches/core/inox-patchset/0001-fix-building-without-safebrowsing.patch new file mode 100644 index 0000000..18fc72a --- /dev/null +++ b/www/chromium-uc/patches/core/inox-patchset/0001-fix-building-without-safebrowsing.patch | |||
| @@ -0,0 +1,1195 @@ | |||
| 1 | --- chrome/browser/BUILD.gn.orig | ||
| 2 | +++ chrome/browser/BUILD.gn | ||
| 3 | @@ -2195,7 +2195,6 @@ static_library("browser") { | ||
| 4 | "//components/reputation/core:proto", | ||
| 5 | "//components/resources", | ||
| 6 | "//components/safe_browsing/content/browser", | ||
| 7 | - "//components/safe_browsing/content/browser:client_side_detection", | ||
| 8 | "//components/safe_browsing/content/browser:safe_browsing_service", | ||
| 9 | "//components/safe_browsing/content/browser/password_protection", | ||
| 10 | "//components/safe_browsing/content/browser/web_ui", | ||
| 11 | @@ -3706,8 +3705,6 @@ static_library("browser") { | ||
| 12 | "download/download_commands.h", | ||
| 13 | "download/download_crx_util.cc", | ||
| 14 | "download/download_crx_util.h", | ||
| 15 | - "download/download_danger_prompt.cc", | ||
| 16 | - "download/download_danger_prompt.h", | ||
| 17 | "download/download_dir_policy_handler.cc", | ||
| 18 | "download/download_dir_policy_handler.h", | ||
| 19 | "download/download_dir_util.cc", | ||
| 20 | --- chrome/browser/browser_process.h.orig | ||
| 21 | +++ chrome/browser/browser_process.h | ||
| 22 | @@ -55,10 +55,6 @@ class NetworkQualityTracker; | ||
| 23 | class SharedURLLoaderFactory; | ||
| 24 | } | ||
| 25 | |||
| 26 | -namespace safe_browsing { | ||
| 27 | -class SafeBrowsingService; | ||
| 28 | -} | ||
| 29 | - | ||
| 30 | namespace subresource_filter { | ||
| 31 | class RulesetService; | ||
| 32 | } | ||
| 33 | @@ -218,9 +214,6 @@ class BrowserProcess { | ||
| 34 | // on this platform (or this is a unit test). | ||
| 35 | virtual StatusTray* status_tray() = 0; | ||
| 36 | |||
| 37 | - // Returns the SafeBrowsing service. | ||
| 38 | - virtual safe_browsing::SafeBrowsingService* safe_browsing_service() = 0; | ||
| 39 | - | ||
| 40 | // Returns the service providing versioned storage for rules used by the Safe | ||
| 41 | // Browsing subresource filter. | ||
| 42 | virtual subresource_filter::RulesetService* | ||
| 43 | --- chrome/browser/browser_process_impl.cc.orig | ||
| 44 | +++ chrome/browser/browser_process_impl.cc | ||
| 45 | @@ -70,7 +70,6 @@ | ||
| 46 | #include "chrome/browser/printing/print_preview_dialog_controller.h" | ||
| 47 | #include "chrome/browser/profiles/profile_manager.h" | ||
| 48 | #include "chrome/browser/resource_coordinator/resource_coordinator_parts.h" | ||
| 49 | -#include "chrome/browser/safe_browsing/safe_browsing_service.h" | ||
| 50 | #include "chrome/browser/shell_integration.h" | ||
| 51 | #include "chrome/browser/site_isolation/prefs_observer.h" | ||
| 52 | #include "chrome/browser/ssl/secure_origin_prefs_observer.h" | ||
| 53 | @@ -395,8 +394,6 @@ void BrowserProcessImpl::StartTearDown() | ||
| 54 | |||
| 55 | metrics_services_manager_.reset(); | ||
| 56 | intranet_redirect_detector_.reset(); | ||
| 57 | - if (safe_browsing_service_.get()) | ||
| 58 | - safe_browsing_service()->ShutDown(); | ||
| 59 | network_time_tracker_.reset(); | ||
| 60 | #if BUILDFLAG(ENABLE_PLUGINS) | ||
| 61 | plugins_resource_service_.reset(); | ||
| 62 | @@ -1030,14 +1027,6 @@ StatusTray* BrowserProcessImpl::status_t | ||
| 63 | return status_tray_.get(); | ||
| 64 | } | ||
| 65 | |||
| 66 | -safe_browsing::SafeBrowsingService* | ||
| 67 | -BrowserProcessImpl::safe_browsing_service() { | ||
| 68 | - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | ||
| 69 | - if (!created_safe_browsing_service_) | ||
| 70 | - CreateSafeBrowsingService(); | ||
| 71 | - return safe_browsing_service_.get(); | ||
| 72 | -} | ||
| 73 | - | ||
| 74 | subresource_filter::RulesetService* | ||
| 75 | BrowserProcessImpl::subresource_filter_ruleset_service() { | ||
| 76 | DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | ||
| 77 | @@ -1300,26 +1289,6 @@ void BrowserProcessImpl::CreateBackgroun | ||
| 78 | #endif | ||
| 79 | } | ||
| 80 | |||
| 81 | -void BrowserProcessImpl::CreateSafeBrowsingService() { | ||
| 82 | - DCHECK(!safe_browsing_service_); | ||
| 83 | - // Set this flag to true so that we don't retry indefinitely to | ||
| 84 | - // create the service class if there was an error. | ||
| 85 | - created_safe_browsing_service_ = true; | ||
| 86 | - | ||
| 87 | - // The factory can be overridden in tests. | ||
| 88 | - if (!safe_browsing::SafeBrowsingServiceInterface::HasFactory()) { | ||
| 89 | - safe_browsing::SafeBrowsingServiceInterface::RegisterFactory( | ||
| 90 | - safe_browsing::GetSafeBrowsingServiceFactory()); | ||
| 91 | - } | ||
| 92 | - | ||
| 93 | - // TODO(crbug/925153): Port consumers of the |safe_browsing_service_| to use | ||
| 94 | - // the interface in components/safe_browsing, and remove this cast. | ||
| 95 | - safe_browsing_service_ = static_cast<safe_browsing::SafeBrowsingService*>( | ||
| 96 | - safe_browsing::SafeBrowsingServiceInterface::CreateSafeBrowsingService()); | ||
| 97 | - if (safe_browsing_service_) | ||
| 98 | - safe_browsing_service_->Initialize(); | ||
| 99 | -} | ||
| 100 | - | ||
| 101 | void BrowserProcessImpl::CreateSubresourceFilterRulesetService() { | ||
| 102 | DCHECK(!subresource_filter_ruleset_service_); | ||
| 103 | created_subresource_filter_ruleset_service_ = true; | ||
| 104 | --- chrome/browser/browser_process_impl.h.orig | ||
| 105 | +++ chrome/browser/browser_process_impl.h | ||
| 106 | @@ -190,7 +190,6 @@ class BrowserProcessImpl : public Browse | ||
| 107 | std::unique_ptr<BackgroundModeManager> manager) override; | ||
| 108 | #endif | ||
| 109 | StatusTray* status_tray() override; | ||
| 110 | - safe_browsing::SafeBrowsingService* safe_browsing_service() override; | ||
| 111 | subresource_filter::RulesetService* subresource_filter_ruleset_service() | ||
| 112 | override; | ||
| 113 | federated_learning::FlocSortingLshClustersService* | ||
| 114 | @@ -344,9 +343,6 @@ class BrowserProcessImpl : public Browse | ||
| 115 | std::unique_ptr<BackgroundModeManager> background_mode_manager_; | ||
| 116 | #endif | ||
| 117 | |||
| 118 | - bool created_safe_browsing_service_ = false; | ||
| 119 | - scoped_refptr<safe_browsing::SafeBrowsingService> safe_browsing_service_; | ||
| 120 | - | ||
| 121 | bool created_subresource_filter_ruleset_service_ = false; | ||
| 122 | std::unique_ptr<subresource_filter::RulesetService> | ||
| 123 | subresource_filter_ruleset_service_; | ||
| 124 | --- chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc.orig | ||
| 125 | +++ chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc | ||
| 126 | @@ -70,7 +70,6 @@ | ||
| 127 | #include "chrome/browser/profiles/profile.h" | ||
| 128 | #include "chrome/browser/profiles/profile_keep_alive_types.h" | ||
| 129 | #include "chrome/browser/profiles/scoped_profile_keep_alive.h" | ||
| 130 | -#include "chrome/browser/safe_browsing/safe_browsing_service.h" | ||
| 131 | #include "chrome/browser/search_engines/template_url_service_factory.h" | ||
| 132 | #include "chrome/browser/share/share_history.h" | ||
| 133 | #include "chrome/browser/share/share_ranking.h" | ||
| 134 | @@ -643,10 +642,6 @@ void ChromeBrowsingDataRemoverDelegate:: | ||
| 135 | base::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies")); | ||
| 136 | |||
| 137 | network::mojom::NetworkContext* safe_browsing_context = nullptr; | ||
| 138 | - safe_browsing::SafeBrowsingService* sb_service = | ||
| 139 | - g_browser_process->safe_browsing_service(); | ||
| 140 | - if (sb_service) | ||
| 141 | - safe_browsing_context = sb_service->GetNetworkContext(profile_); | ||
| 142 | |||
| 143 | browsing_data::RemoveEmbedderCookieData( | ||
| 144 | delete_begin, delete_end, filter_builder, host_content_settings_map_, | ||
| 145 | --- chrome/browser/chrome_content_browser_client.cc.orig | ||
| 146 | +++ chrome/browser/chrome_content_browser_client.cc | ||
| 147 | @@ -921,34 +921,6 @@ void SetApplicationLocaleOnIOThread(cons | ||
| 148 | GetIOThreadApplicationLocale() = locale; | ||
| 149 | } | ||
| 150 | |||
| 151 | -// An implementation of the SSLCertReporter interface used by | ||
| 152 | -// SSLErrorHandler. Uses CertificateReportingService to send reports. The | ||
| 153 | -// service handles queueing and re-sending of failed reports. Each certificate | ||
| 154 | -// error creates a new instance of this class. | ||
| 155 | -class CertificateReportingServiceCertReporter : public SSLCertReporter { | ||
| 156 | - public: | ||
| 157 | - explicit CertificateReportingServiceCertReporter( | ||
| 158 | - content::WebContents* web_contents) | ||
| 159 | - : service_(CertificateReportingServiceFactory::GetForBrowserContext( | ||
| 160 | - web_contents->GetBrowserContext())) {} | ||
| 161 | - | ||
| 162 | - CertificateReportingServiceCertReporter( | ||
| 163 | - const CertificateReportingServiceCertReporter&) = delete; | ||
| 164 | - CertificateReportingServiceCertReporter& operator=( | ||
| 165 | - const CertificateReportingServiceCertReporter&) = delete; | ||
| 166 | - | ||
| 167 | - ~CertificateReportingServiceCertReporter() override {} | ||
| 168 | - | ||
| 169 | - // SSLCertReporter implementation | ||
| 170 | - void ReportInvalidCertificateChain( | ||
| 171 | - const std::string& serialized_report) override { | ||
| 172 | - service_->Send(serialized_report); | ||
| 173 | - } | ||
| 174 | - | ||
| 175 | - private: | ||
| 176 | - CertificateReportingService* service_; | ||
| 177 | -}; | ||
| 178 | - | ||
| 179 | #if BUILDFLAG(ENABLE_EXTENSIONS) | ||
| 180 | |||
| 181 | AppLoadedInTabSource ClassifyAppLoadedInTabSource( | ||
| 182 | @@ -1423,7 +1395,6 @@ void ChromeContentBrowserClient::PostAft | ||
| 183 | InitNetworkContextsParentDirectory(); | ||
| 184 | |||
| 185 | DCHECK_CURRENTLY_ON(BrowserThread::UI); | ||
| 186 | - safe_browsing_service_ = g_browser_process->safe_browsing_service(); | ||
| 187 | } | ||
| 188 | |||
| 189 | bool ChromeContentBrowserClient::IsBrowserStartupComplete() { | ||
| 190 | @@ -4229,7 +4200,7 @@ ChromeContentBrowserClient::CreateThrott | ||
| 191 | content::WebContents* web_contents = handle->GetWebContents(); | ||
| 192 | throttles.push_back(std::make_unique<SSLErrorNavigationThrottle>( | ||
| 193 | handle, | ||
| 194 | - std::make_unique<CertificateReportingServiceCertReporter>(web_contents), | ||
| 195 | + nullptr, | ||
| 196 | base::BindOnce(&HandleSSLErrorWrapper), base::BindOnce(&IsInHostedApp), | ||
| 197 | base::BindOnce( | ||
| 198 | &ShouldIgnoreSslInterstitialBecauseNavigationDefaultedToHttps))); | ||
| 199 | @@ -4258,15 +4229,6 @@ ChromeContentBrowserClient::CreateThrott | ||
| 200 | &throttles); | ||
| 201 | #endif | ||
| 202 | |||
| 203 | - // g_browser_process->safe_browsing_service() may be null in unittests. | ||
| 204 | - safe_browsing::SafeBrowsingUIManager* ui_manager = | ||
| 205 | - g_browser_process->safe_browsing_service() | ||
| 206 | - ? g_browser_process->safe_browsing_service()->ui_manager().get() | ||
| 207 | - : nullptr; | ||
| 208 | - throttles.push_back( | ||
| 209 | - std::make_unique<safe_browsing::SafeBrowsingNavigationThrottle>( | ||
| 210 | - handle, ui_manager)); | ||
| 211 | - | ||
| 212 | if (base::FeatureList::IsEnabled(safe_browsing::kDelayedWarnings)) { | ||
| 213 | throttles.push_back( | ||
| 214 | std::make_unique<safe_browsing::DelayedWarningNavigationThrottle>( | ||
| 215 | --- chrome/browser/component_updater/file_type_policies_component_installer.cc.orig | ||
| 216 | +++ chrome/browser/component_updater/file_type_policies_component_installer.cc | ||
| 217 | @@ -40,20 +40,6 @@ const uint8_t kFileTypePoliciesPublicKey | ||
| 218 | const char kFileTypePoliciesManifestName[] = "File Type Policies"; | ||
| 219 | |||
| 220 | void LoadFileTypesFromDisk(const base::FilePath& pb_path) { | ||
| 221 | - if (pb_path.empty()) | ||
| 222 | - return; | ||
| 223 | - | ||
| 224 | - VLOG(1) << "Reading Download File Types from file: " << pb_path.value(); | ||
| 225 | - std::string binary_pb; | ||
| 226 | - if (!base::ReadFileToString(pb_path, &binary_pb)) { | ||
| 227 | - // The file won't exist on new installations, so this is not always an | ||
| 228 | - // error. | ||
| 229 | - VLOG(1) << "Failed reading from " << pb_path.value(); | ||
| 230 | - return; | ||
| 231 | - } | ||
| 232 | - | ||
| 233 | - safe_browsing::FileTypePolicies::GetInstance()->PopulateFromDynamicUpdate( | ||
| 234 | - binary_pb); | ||
| 235 | } | ||
| 236 | |||
| 237 | } // namespace | ||
| 238 | --- chrome/browser/download/chrome_download_manager_delegate.cc.orig | ||
| 239 | +++ chrome/browser/download/chrome_download_manager_delegate.cc | ||
| 240 | @@ -436,13 +436,6 @@ ChromeDownloadManagerDelegate::~ChromeDo | ||
| 241 | |||
| 242 | void ChromeDownloadManagerDelegate::SetDownloadManager(DownloadManager* dm) { | ||
| 243 | download_manager_ = dm; | ||
| 244 | - | ||
| 245 | - safe_browsing::SafeBrowsingService* sb_service = | ||
| 246 | - g_browser_process->safe_browsing_service(); | ||
| 247 | - if (sb_service && !profile_->IsOffTheRecord()) { | ||
| 248 | - // Include this download manager in the set monitored by safe browsing. | ||
| 249 | - sb_service->AddDownloadManager(dm); | ||
| 250 | - } | ||
| 251 | } | ||
| 252 | |||
| 253 | #if defined(OS_ANDROID) | ||
| 254 | @@ -791,16 +784,6 @@ void ChromeDownloadManagerDelegate::Choo | ||
| 255 | |||
| 256 | void ChromeDownloadManagerDelegate::SanitizeSavePackageResourceName( | ||
| 257 | base::FilePath* filename) { | ||
| 258 | - safe_browsing::FileTypePolicies* file_type_policies = | ||
| 259 | - safe_browsing::FileTypePolicies::GetInstance(); | ||
| 260 | - | ||
| 261 | - if (file_type_policies->GetFileDangerLevel(*filename) == | ||
| 262 | - safe_browsing::DownloadFileType::NOT_DANGEROUS) | ||
| 263 | - return; | ||
| 264 | - | ||
| 265 | - base::FilePath default_filename = base::FilePath::FromUTF8Unsafe( | ||
| 266 | - l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME)); | ||
| 267 | - *filename = filename->AddExtension(default_filename.BaseName().value()); | ||
| 268 | } | ||
| 269 | |||
| 270 | void ChromeDownloadManagerDelegate::SanitizeDownloadParameters( | ||
| 271 | --- chrome/browser/download/download_item_model.cc.orig | ||
| 272 | +++ chrome/browser/download/download_item_model.cc | ||
| 273 | @@ -86,7 +86,7 @@ class DownloadItemModelData : public bas | ||
| 274 | |||
| 275 | // Danger level of the file determined based on the file type and whether | ||
| 276 | // there was a user action associated with the download. | ||
| 277 | - DownloadFileType::DangerLevel danger_level_; | ||
| 278 | + safe_browsing::DownloadFileType::DangerLevel danger_level_; | ||
| 279 | |||
| 280 | // Whether the download is currently being revived. | ||
| 281 | bool is_being_revived_; | ||
| 282 | @@ -123,7 +123,7 @@ DownloadItemModelData::DownloadItemModel | ||
| 283 | : should_show_in_shelf_(true), | ||
| 284 | was_ui_notified_(false), | ||
| 285 | should_prefer_opening_in_browser_(false), | ||
| 286 | - danger_level_(DownloadFileType::NOT_DANGEROUS), | ||
| 287 | + danger_level_(safe_browsing::DownloadFileType::NOT_DANGEROUS), | ||
| 288 | is_being_revived_(false) {} | ||
| 289 | |||
| 290 | } // namespace | ||
| 291 | @@ -381,13 +381,13 @@ void DownloadItemModel::SetShouldPreferO | ||
| 292 | data->should_prefer_opening_in_browser_ = preference; | ||
| 293 | } | ||
| 294 | |||
| 295 | -DownloadFileType::DangerLevel DownloadItemModel::GetDangerLevel() const { | ||
| 296 | +safe_browsing::DownloadFileType::DangerLevel DownloadItemModel::GetDangerLevel() const { | ||
| 297 | const DownloadItemModelData* data = DownloadItemModelData::Get(download_); | ||
| 298 | - return data ? data->danger_level_ : DownloadFileType::NOT_DANGEROUS; | ||
| 299 | + return data ? data->danger_level_ : safe_browsing::DownloadFileType::NOT_DANGEROUS; | ||
| 300 | } | ||
| 301 | |||
| 302 | void DownloadItemModel::SetDangerLevel( | ||
| 303 | - DownloadFileType::DangerLevel danger_level) { | ||
| 304 | + safe_browsing::DownloadFileType::DangerLevel danger_level) { | ||
| 305 | DownloadItemModelData* data = DownloadItemModelData::GetOrCreate(download_); | ||
| 306 | data->danger_level_ = danger_level; | ||
| 307 | } | ||
| 308 | @@ -599,9 +599,6 @@ bool DownloadItemModel::IsCommandEnabled | ||
| 309 | // filename. Don't base an "Always open" decision based on it. Also | ||
| 310 | // exclude extensions. | ||
| 311 | return download_->CanOpenDownload() && | ||
| 312 | - safe_browsing::FileTypePolicies::GetInstance() | ||
| 313 | - ->IsAllowedToOpenAutomatically( | ||
| 314 | - download_->GetTargetFilePath()) && | ||
| 315 | !download_crx_util::IsExtensionDownload(*download_); | ||
| 316 | case DownloadCommands::PAUSE: | ||
| 317 | return !download_->IsSavePackageDownload() && | ||
| 318 | --- chrome/browser/download/download_prefs.cc.orig | ||
| 319 | +++ chrome/browser/download/download_prefs.cc | ||
| 320 | @@ -260,14 +260,7 @@ DownloadPrefs::DownloadPrefs(Profile* pr | ||
| 321 | base::FilePath::StringType(1, base::FilePath::kExtensionSeparator) + | ||
| 322 | extension); | ||
| 323 | |||
| 324 | - // Note that the list of file types that are not allowed to open | ||
| 325 | - // automatically can change in the future. When the list is tightened, it is | ||
| 326 | - // expected that some entries in the users' auto open list will get dropped | ||
| 327 | - // permanently as a result. | ||
| 328 | - if (FileTypePolicies::GetInstance()->IsAllowedToOpenAutomatically( | ||
| 329 | - filename_with_extension)) { | ||
| 330 | - auto_open_by_user_.insert(extension); | ||
| 331 | - } | ||
| 332 | + auto_open_by_user_.insert(extension); | ||
| 333 | } | ||
| 334 | } | ||
| 335 | |||
| 336 | @@ -475,10 +468,6 @@ bool DownloadPrefs::IsAutoOpenByPolicy(c | ||
| 337 | bool DownloadPrefs::EnableAutoOpenByUserBasedOnExtension( | ||
| 338 | const base::FilePath& file_name) { | ||
| 339 | base::FilePath::StringType extension = file_name.Extension(); | ||
| 340 | - if (!FileTypePolicies::GetInstance()->IsAllowedToOpenAutomatically( | ||
| 341 | - file_name)) { | ||
| 342 | - return false; | ||
| 343 | - } | ||
| 344 | |||
| 345 | DCHECK(extension[0] == base::FilePath::kExtensionSeparator); | ||
| 346 | extension.erase(0, 1); | ||
| 347 | --- chrome/browser/download/download_target_determiner.cc.orig | ||
| 348 | +++ chrome/browser/download/download_target_determiner.cc | ||
| 349 | @@ -297,13 +297,6 @@ base::FilePath DownloadTargetDeterminer: | ||
| 350 | download_->GetURL(), download_->GetContentDisposition(), referrer_charset, | ||
| 351 | suggested_filename, sniffed_mime_type, default_filename); | ||
| 352 | |||
| 353 | - // We don't replace the file extension if sfafe browsing consider the file | ||
| 354 | - // extension to be unsafe. Just let safe browsing scan the generated file. | ||
| 355 | - if (safe_browsing::FileTypePolicies::GetInstance()->IsCheckedBinaryFile( | ||
| 356 | - generated_filename)) { | ||
| 357 | - return generated_filename; | ||
| 358 | - } | ||
| 359 | - | ||
| 360 | // If no mime type or explicitly specified a name, don't replace file | ||
| 361 | // extension. | ||
| 362 | if (sniffed_mime_type.empty() || !suggested_filename.empty()) | ||
| 363 | @@ -1113,29 +1106,7 @@ DownloadFileType::DangerLevel DownloadTa | ||
| 364 | download_->HasUserGesture()) | ||
| 365 | return DownloadFileType::NOT_DANGEROUS; | ||
| 366 | |||
| 367 | - DownloadFileType::DangerLevel danger_level = | ||
| 368 | - safe_browsing::FileTypePolicies::GetInstance()->GetFileDangerLevel( | ||
| 369 | - virtual_path_.BaseName()); | ||
| 370 | - | ||
| 371 | - // A danger level of ALLOW_ON_USER_GESTURE is used to label potentially | ||
| 372 | - // dangerous file types that have a high frequency of legitimate use. We would | ||
| 373 | - // like to avoid prompting for the legitimate cases as much as possible. To | ||
| 374 | - // that end, we consider a download to be legitimate if one of the following | ||
| 375 | - // is true, and avoid prompting: | ||
| 376 | - // | ||
| 377 | - // * The user navigated to the download URL via the omnibox (either by typing | ||
| 378 | - // the URL, pasting it, or using search). | ||
| 379 | - // | ||
| 380 | - // * The navigation that initiated the download has a user gesture associated | ||
| 381 | - // with it AND the user the user is familiar with the referring origin. A | ||
| 382 | - // user is considered familiar with a referring origin if a visit for a page | ||
| 383 | - // from the same origin was recorded on the previous day or earlier. | ||
| 384 | - if (danger_level == DownloadFileType::ALLOW_ON_USER_GESTURE && | ||
| 385 | - ((download_->GetTransitionType() & | ||
| 386 | - ui::PAGE_TRANSITION_FROM_ADDRESS_BAR) != 0 || | ||
| 387 | - (download_->HasUserGesture() && visits == VISITED_REFERRER))) | ||
| 388 | - return DownloadFileType::NOT_DANGEROUS; | ||
| 389 | - return danger_level; | ||
| 390 | + return DownloadFileType::NOT_DANGEROUS; | ||
| 391 | } | ||
| 392 | |||
| 393 | absl::optional<base::Time> | ||
| 394 | --- chrome/browser/extensions/api/downloads/downloads_api.cc.orig | ||
| 395 | +++ chrome/browser/extensions/api/downloads/downloads_api.cc | ||
| 396 | @@ -36,7 +36,6 @@ | ||
| 397 | #include "chrome/browser/browser_process.h" | ||
| 398 | #include "chrome/browser/download/download_core_service.h" | ||
| 399 | #include "chrome/browser/download/download_core_service_factory.h" | ||
| 400 | -#include "chrome/browser/download/download_danger_prompt.h" | ||
| 401 | #include "chrome/browser/download/download_file_icon_extractor.h" | ||
| 402 | #include "chrome/browser/download/download_open_prompt.h" | ||
| 403 | #include "chrome/browser/download/download_prefs.h" | ||
| 404 | @@ -1274,9 +1273,6 @@ DownloadsAcceptDangerFunction::Downloads | ||
| 405 | |||
| 406 | DownloadsAcceptDangerFunction::~DownloadsAcceptDangerFunction() {} | ||
| 407 | |||
| 408 | -DownloadsAcceptDangerFunction::OnPromptCreatedCallback* | ||
| 409 | - DownloadsAcceptDangerFunction::on_prompt_created_ = NULL; | ||
| 410 | - | ||
| 411 | ExtensionFunction::ResponseAction DownloadsAcceptDangerFunction::Run() { | ||
| 412 | std::unique_ptr<downloads::AcceptDanger::Params> params( | ||
| 413 | downloads::AcceptDanger::Params::Create(args())); | ||
| 414 | @@ -1314,42 +1310,7 @@ void DownloadsAcceptDangerFunction::Prom | ||
| 415 | return; | ||
| 416 | } | ||
| 417 | RecordApiFunctions(DOWNLOADS_FUNCTION_ACCEPT_DANGER); | ||
| 418 | - // DownloadDangerPrompt displays a modal dialog using native widgets that the | ||
| 419 | - // user must either accept or cancel. It cannot be scripted. | ||
| 420 | - DownloadDangerPrompt* prompt = DownloadDangerPrompt::Create( | ||
| 421 | - download_item, web_contents, true, | ||
| 422 | - base::BindOnce(&DownloadsAcceptDangerFunction::DangerPromptCallback, this, | ||
| 423 | - download_id)); | ||
| 424 | - // DownloadDangerPrompt deletes itself | ||
| 425 | - if (on_prompt_created_ && !on_prompt_created_->is_null()) | ||
| 426 | - std::move(*on_prompt_created_).Run(prompt); | ||
| 427 | - // Function finishes in DangerPromptCallback(). | ||
| 428 | -} | ||
| 429 | - | ||
| 430 | -void DownloadsAcceptDangerFunction::DangerPromptCallback( | ||
| 431 | - int download_id, | ||
| 432 | - DownloadDangerPrompt::Action action) { | ||
| 433 | - DCHECK_CURRENTLY_ON(BrowserThread::UI); | ||
| 434 | - DownloadItem* download_item = GetDownload( | ||
| 435 | - browser_context(), include_incognito_information(), download_id); | ||
| 436 | - std::string error; | ||
| 437 | - if (InvalidId(download_item, &error) || | ||
| 438 | - Fault(download_item->GetState() != DownloadItem::IN_PROGRESS, | ||
| 439 | - download_extension_errors::kNotInProgress, &error)) { | ||
| 440 | - Respond(Error(std::move(error))); | ||
| 441 | - return; | ||
| 442 | - } | ||
| 443 | - switch (action) { | ||
| 444 | - case DownloadDangerPrompt::ACCEPT: | ||
| 445 | - download_item->ValidateDangerousDownload(); | ||
| 446 | - break; | ||
| 447 | - case DownloadDangerPrompt::CANCEL: | ||
| 448 | - download_item->Remove(); | ||
| 449 | - break; | ||
| 450 | - case DownloadDangerPrompt::DISMISS: | ||
| 451 | - break; | ||
| 452 | - } | ||
| 453 | - Respond(NoArguments()); | ||
| 454 | + download_item->ValidateDangerousDownload(); | ||
| 455 | } | ||
| 456 | |||
| 457 | DownloadsShowFunction::DownloadsShowFunction() {} | ||
| 458 | --- chrome/browser/extensions/api/downloads/downloads_api.h.orig | ||
| 459 | +++ chrome/browser/extensions/api/downloads/downloads_api.h | ||
| 460 | @@ -13,7 +13,6 @@ | ||
| 461 | #include "base/macros.h" | ||
| 462 | #include "base/scoped_observation.h" | ||
| 463 | #include "base/time/time.h" | ||
| 464 | -#include "chrome/browser/download/download_danger_prompt.h" | ||
| 465 | #include "chrome/common/extensions/api/downloads.h" | ||
| 466 | #include "components/download/content/public/all_download_item_notifier.h" | ||
| 467 | #include "components/download/public/common/download_path_reservation_tracker.h" | ||
| 468 | @@ -199,13 +198,6 @@ class DownloadsRemoveFileFunction : publ | ||
| 469 | |||
| 470 | class DownloadsAcceptDangerFunction : public ExtensionFunction { | ||
| 471 | public: | ||
| 472 | - using OnPromptCreatedCallback = | ||
| 473 | - base::OnceCallback<void(DownloadDangerPrompt*)>; | ||
| 474 | - static void OnPromptCreatedForTesting( | ||
| 475 | - OnPromptCreatedCallback* callback) { | ||
| 476 | - on_prompt_created_ = callback; | ||
| 477 | - } | ||
| 478 | - | ||
| 479 | DECLARE_EXTENSION_FUNCTION("downloads.acceptDanger", DOWNLOADS_ACCEPTDANGER) | ||
| 480 | DownloadsAcceptDangerFunction(); | ||
| 481 | |||
| 482 | @@ -217,13 +209,10 @@ class DownloadsAcceptDangerFunction : pu | ||
| 483 | |||
| 484 | protected: | ||
| 485 | ~DownloadsAcceptDangerFunction() override; | ||
| 486 | - void DangerPromptCallback(int download_id, | ||
| 487 | - DownloadDangerPrompt::Action action); | ||
| 488 | |||
| 489 | private: | ||
| 490 | void PromptOrWait(int download_id, int retries); | ||
| 491 | |||
| 492 | - static OnPromptCreatedCallback* on_prompt_created_; | ||
| 493 | }; | ||
| 494 | |||
| 495 | class DownloadsShowFunction : public ExtensionFunction { | ||
| 496 | --- chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_api.cc.orig | ||
| 497 | +++ chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_api.cc | ||
| 498 | @@ -54,38 +54,7 @@ SafeBrowsingPrivateGetReferrerChainFunct | ||
| 499 | base::StringPrintf("Could not find tab with id %d.", params->tab_id))); | ||
| 500 | } | ||
| 501 | |||
| 502 | - Profile* profile = Profile::FromBrowserContext(browser_context()); | ||
| 503 | - if (!SafeBrowsingNavigationObserverManager::IsEnabledAndReady( | ||
| 504 | - profile->GetPrefs(), g_browser_process->safe_browsing_service())) | ||
| 505 | - return RespondNow(NoArguments()); | ||
| 506 | - | ||
| 507 | - SafeBrowsingNavigationObserverManager* navigation_observer_manager = | ||
| 508 | - safe_browsing::SafeBrowsingNavigationObserverManagerFactory:: | ||
| 509 | - GetForBrowserContext(profile); | ||
| 510 | - | ||
| 511 | - safe_browsing::ReferrerChain referrer_chain; | ||
| 512 | - SafeBrowsingNavigationObserverManager::AttributionResult result = | ||
| 513 | - navigation_observer_manager->IdentifyReferrerChainByWebContents( | ||
| 514 | - contents, kReferrerUserGestureLimit, &referrer_chain); | ||
| 515 | - | ||
| 516 | - // If the referrer chain is incomplete we'll append the most recent | ||
| 517 | - // navigations to referrer chain for diagnostic purposes. This only happens if | ||
| 518 | - // the user is not in incognito mode and has opted into extended reporting or | ||
| 519 | - // Scout reporting. Otherwise, |CountOfRecentNavigationsToAppend| returns 0. | ||
| 520 | - int recent_navigations_to_collect = | ||
| 521 | - SafeBrowsingNavigationObserverManager::CountOfRecentNavigationsToAppend( | ||
| 522 | - profile, profile->GetPrefs(), result); | ||
| 523 | - if (recent_navigations_to_collect > 0) { | ||
| 524 | - navigation_observer_manager->AppendRecentNavigations( | ||
| 525 | - recent_navigations_to_collect, &referrer_chain); | ||
| 526 | - } | ||
| 527 | - | ||
| 528 | std::vector<api::safe_browsing_private::ReferrerChainEntry> referrer_entries; | ||
| 529 | - referrer_entries.reserve(referrer_chain.size()); | ||
| 530 | - for (const auto& entry : referrer_chain) { | ||
| 531 | - referrer_entries.emplace_back( | ||
| 532 | - safe_browsing_util::ReferrerToReferrerChainEntry(entry)); | ||
| 533 | - } | ||
| 534 | return RespondNow(ArgumentList( | ||
| 535 | api::safe_browsing_private::GetReferrerChain::Results::Create( | ||
| 536 | referrer_entries))); | ||
| 537 | --- chrome/browser/extensions/api/webstore_private/webstore_private_api.cc.orig | ||
| 538 | +++ chrome/browser/extensions/api/webstore_private/webstore_private_api.cc | ||
| 539 | @@ -683,18 +683,6 @@ void WebstorePrivateBeginInstallWithMani | ||
| 540 | |||
| 541 | void WebstorePrivateBeginInstallWithManifest3Function:: | ||
| 542 | ReportFrictionAcceptedEvent() { | ||
| 543 | - if (!profile_) { | ||
| 544 | - return; | ||
| 545 | - } | ||
| 546 | - auto* metrics_collector = | ||
| 547 | - safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile( | ||
| 548 | - profile_); | ||
| 549 | - // `metrics_collector` can be null in incognito. | ||
| 550 | - if (metrics_collector) { | ||
| 551 | - metrics_collector->AddSafeBrowsingEventToPref( | ||
| 552 | - safe_browsing::SafeBrowsingMetricsCollector::EventType:: | ||
| 553 | - EXTENSION_ALLOWLIST_INSTALL_BYPASS); | ||
| 554 | - } | ||
| 555 | } | ||
| 556 | |||
| 557 | void WebstorePrivateBeginInstallWithManifest3Function::OnInstallPromptDone( | ||
| 558 | @@ -1159,52 +1147,9 @@ WebstorePrivateGetReferrerChainFunction: | ||
| 559 | |||
| 560 | ExtensionFunction::ResponseAction | ||
| 561 | WebstorePrivateGetReferrerChainFunction::Run() { | ||
| 562 | - Profile* profile = Profile::FromBrowserContext(browser_context()); | ||
| 563 | - if (!SafeBrowsingNavigationObserverManager::IsEnabledAndReady( | ||
| 564 | - profile->GetPrefs(), g_browser_process->safe_browsing_service())) | ||
| 565 | - return RespondNow(ArgumentList( | ||
| 566 | - api::webstore_private::GetReferrerChain::Results::Create(""))); | ||
| 567 | - | ||
| 568 | - content::WebContents* web_contents = GetSenderWebContents(); | ||
| 569 | - if (!web_contents) { | ||
| 570 | - return RespondNow(ErrorWithArguments( | ||
| 571 | - api::webstore_private::GetReferrerChain::Results::Create(""), | ||
| 572 | - kWebstoreUserCancelledError)); | ||
| 573 | - } | ||
| 574 | - | ||
| 575 | - SafeBrowsingNavigationObserverManager* navigation_observer_manager = | ||
| 576 | - safe_browsing::SafeBrowsingNavigationObserverManagerFactory:: | ||
| 577 | - GetForBrowserContext(profile); | ||
| 578 | - | ||
| 579 | - safe_browsing::ReferrerChain referrer_chain; | ||
| 580 | - SafeBrowsingNavigationObserverManager::AttributionResult result = | ||
| 581 | - navigation_observer_manager->IdentifyReferrerChainByWebContents( | ||
| 582 | - web_contents, kExtensionReferrerUserGestureLimit, &referrer_chain); | ||
| 583 | - | ||
| 584 | - // If the referrer chain is incomplete we'll append the most recent | ||
| 585 | - // navigations to referrer chain for diagnostic purposes. This only happens if | ||
| 586 | - // the user is not in incognito mode and has opted into extended reporting or | ||
| 587 | - // Scout reporting. Otherwise, |CountOfRecentNavigationsToAppend| returns 0. | ||
| 588 | - int recent_navigations_to_collect = | ||
| 589 | - SafeBrowsingNavigationObserverManager::CountOfRecentNavigationsToAppend( | ||
| 590 | - profile, profile->GetPrefs(), result); | ||
| 591 | - if (recent_navigations_to_collect > 0) { | ||
| 592 | - navigation_observer_manager->AppendRecentNavigations( | ||
| 593 | - recent_navigations_to_collect, &referrer_chain); | ||
| 594 | - } | ||
| 595 | - | ||
| 596 | - safe_browsing::ExtensionWebStoreInstallRequest request; | ||
| 597 | - request.mutable_referrer_chain()->Swap(&referrer_chain); | ||
| 598 | - request.mutable_referrer_chain_options()->set_recent_navigations_to_collect( | ||
| 599 | - recent_navigations_to_collect); | ||
| 600 | - | ||
| 601 | - std::string serialized_referrer_proto = request.SerializeAsString(); | ||
| 602 | - // Base64 encode the proto to avoid issues with base::Value rejecting strings | ||
| 603 | - // which are not valid UTF8. | ||
| 604 | - base::Base64Encode(serialized_referrer_proto, &serialized_referrer_proto); | ||
| 605 | return RespondNow( | ||
| 606 | ArgumentList(api::webstore_private::GetReferrerChain::Results::Create( | ||
| 607 | - serialized_referrer_proto))); | ||
| 608 | + ""))); | ||
| 609 | } | ||
| 610 | |||
| 611 | WebstorePrivateGetExtensionStatusFunction:: | ||
| 612 | --- chrome/browser/extensions/blocklist_state_fetcher.cc.orig | ||
| 613 | +++ chrome/browser/extensions/blocklist_state_fetcher.cc | ||
| 614 | @@ -34,33 +34,8 @@ BlocklistStateFetcher::~BlocklistStateFe | ||
| 615 | void BlocklistStateFetcher::Request(const std::string& id, | ||
| 616 | RequestCallback callback) { | ||
| 617 | DCHECK_CURRENTLY_ON(BrowserThread::UI); | ||
| 618 | - if (!safe_browsing_config_) { | ||
| 619 | - if (g_browser_process && g_browser_process->safe_browsing_service()) { | ||
| 620 | - SetSafeBrowsingConfig( | ||
| 621 | - g_browser_process->safe_browsing_service()->GetV4ProtocolConfig()); | ||
| 622 | - } else { | ||
| 623 | - base::ThreadTaskRunnerHandle::Get()->PostTask( | ||
| 624 | - FROM_HERE, base::BindOnce(std::move(callback), BLOCKLISTED_UNKNOWN)); | ||
| 625 | - return; | ||
| 626 | - } | ||
| 627 | - } | ||
| 628 | - | ||
| 629 | - bool request_already_sent = base::Contains(callbacks_, id); | ||
| 630 | - callbacks_.insert(std::make_pair(id, std::move(callback))); | ||
| 631 | - if (request_already_sent) | ||
| 632 | - return; | ||
| 633 | - | ||
| 634 | - if (g_browser_process && g_browser_process->safe_browsing_service()) { | ||
| 635 | - if (base::FeatureList::IsEnabled( | ||
| 636 | - safe_browsing::kSafeBrowsingRemoveCookies)) { | ||
| 637 | - url_loader_factory_ = g_browser_process->shared_url_loader_factory(); | ||
| 638 | - } else { | ||
| 639 | - url_loader_factory_ = | ||
| 640 | - g_browser_process->safe_browsing_service()->GetURLLoaderFactory(); | ||
| 641 | - } | ||
| 642 | - } | ||
| 643 | - | ||
| 644 | - SendRequest(id); | ||
| 645 | + base::ThreadTaskRunnerHandle::Get()->PostTask( | ||
| 646 | + FROM_HERE, base::BindOnce(std::move(callback), BLOCKLISTED_UNKNOWN)); | ||
| 647 | } | ||
| 648 | |||
| 649 | void BlocklistStateFetcher::SendRequest(const std::string& id) { | ||
| 650 | @@ -71,8 +46,7 @@ void BlocklistStateFetcher::SendRequest( | ||
| 651 | std::string request_str; | ||
| 652 | request.SerializeToString(&request_str); | ||
| 653 | |||
| 654 | - GURL request_url = GURL(safe_browsing::GetReportUrl( | ||
| 655 | - *safe_browsing_config_, "clientreport/crx-list-info")); | ||
| 656 | + GURL request_url = GURL(); | ||
| 657 | net::NetworkTrafficAnnotationTag traffic_annotation = | ||
| 658 | net::DefineNetworkTrafficAnnotation("extension_blacklist", R"( | ||
| 659 | semantics { | ||
| 660 | @@ -122,12 +96,6 @@ void BlocklistStateFetcher::SendRequest( | ||
| 661 | base::Unretained(this), fetcher)); | ||
| 662 | } | ||
| 663 | |||
| 664 | -void BlocklistStateFetcher::SetSafeBrowsingConfig( | ||
| 665 | - const safe_browsing::V4ProtocolConfig& config) { | ||
| 666 | - safe_browsing_config_ = | ||
| 667 | - std::make_unique<safe_browsing::V4ProtocolConfig>(config); | ||
| 668 | -} | ||
| 669 | - | ||
| 670 | void BlocklistStateFetcher::OnURLLoaderComplete( | ||
| 671 | network::SimpleURLLoader* url_loader, | ||
| 672 | std::unique_ptr<std::string> response_body) { | ||
| 673 | --- chrome/browser/extensions/blocklist_state_fetcher.h.orig | ||
| 674 | +++ chrome/browser/extensions/blocklist_state_fetcher.h | ||
| 675 | @@ -37,8 +37,6 @@ class BlocklistStateFetcher { | ||
| 676 | |||
| 677 | virtual void Request(const std::string& id, RequestCallback callback); | ||
| 678 | |||
| 679 | - void SetSafeBrowsingConfig(const safe_browsing::V4ProtocolConfig& config); | ||
| 680 | - | ||
| 681 | protected: | ||
| 682 | void OnURLLoaderComplete(network::SimpleURLLoader* url_loader, | ||
| 683 | std::unique_ptr<std::string> response_body); | ||
| 684 | @@ -57,7 +55,6 @@ class BlocklistStateFetcher { | ||
| 685 | |||
| 686 | void SendRequest(const std::string& id); | ||
| 687 | |||
| 688 | - std::unique_ptr<safe_browsing::V4ProtocolConfig> safe_browsing_config_; | ||
| 689 | scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_; | ||
| 690 | |||
| 691 | // SimpleURLLoader -> (owned loader, extension id). | ||
| 692 | --- chrome/browser/metrics/chrome_metrics_service_client.cc.orig | ||
| 693 | +++ chrome/browser/metrics/chrome_metrics_service_client.cc | ||
| 694 | @@ -828,9 +828,6 @@ void ChromeMetricsServiceClient::Registe | ||
| 695 | metrics_service_->RegisterMetricsProvider( | ||
| 696 | std::make_unique<HttpsEngagementMetricsProvider>()); | ||
| 697 | |||
| 698 | - metrics_service_->RegisterMetricsProvider( | ||
| 699 | - std::make_unique<CertificateReportingMetricsProvider>()); | ||
| 700 | - | ||
| 701 | #if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) | ||
| 702 | metrics_service_->RegisterMetricsProvider( | ||
| 703 | std::make_unique<UpgradeMetricsProvider>()); | ||
| 704 | --- chrome/browser/net/trial_comparison_cert_verifier_controller.cc.orig | ||
| 705 | +++ chrome/browser/net/trial_comparison_cert_verifier_controller.cc | ||
| 706 | @@ -138,9 +138,6 @@ void TrialComparisonCertVerifierControll | ||
| 707 | std::string serialized_report; | ||
| 708 | if (!report.Serialize(&serialized_report)) | ||
| 709 | return; | ||
| 710 | - | ||
| 711 | - CertificateReportingServiceFactory::GetForBrowserContext(profile_)->Send( | ||
| 712 | - serialized_report); | ||
| 713 | } | ||
| 714 | |||
| 715 | // static | ||
| 716 | --- chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc.orig | ||
| 717 | +++ chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc | ||
| 718 | @@ -297,7 +297,6 @@ void ChromeBrowserMainExtraPartsProfiles | ||
| 719 | #if BUILDFLAG(IS_CHROMEOS_LACROS) | ||
| 720 | CertDbInitializerFactory::GetInstance(); | ||
| 721 | #endif | ||
| 722 | - CertificateReportingServiceFactory::GetInstance(); | ||
| 723 | #if !defined(OS_ANDROID) | ||
| 724 | ChromeBrowsingDataLifetimeManagerFactory::GetInstance(); | ||
| 725 | #endif | ||
| 726 | --- chrome/browser/profiles/profile_impl.cc.orig | ||
| 727 | +++ chrome/browser/profiles/profile_impl.cc | ||
| 728 | @@ -93,7 +93,6 @@ | ||
| 729 | #include "chrome/browser/profiles/profile_metrics.h" | ||
| 730 | #include "chrome/browser/push_messaging/push_messaging_service_factory.h" | ||
| 731 | #include "chrome/browser/push_messaging/push_messaging_service_impl.h" | ||
| 732 | -#include "chrome/browser/safe_browsing/safe_browsing_service.h" | ||
| 733 | #include "chrome/browser/sessions/exit_type_service.h" | ||
| 734 | #include "chrome/browser/sharing/sharing_service_factory.h" | ||
| 735 | #include "chrome/browser/signin/identity_manager_factory.h" | ||
| 736 | @@ -627,17 +626,6 @@ void ProfileImpl::LoadPrefsForNormalStar | ||
| 737 | |||
| 738 | mojo::PendingRemote<prefs::mojom::TrackedPreferenceValidationDelegate> | ||
| 739 | pref_validation_delegate; | ||
| 740 | - scoped_refptr<safe_browsing::SafeBrowsingService> safe_browsing_service( | ||
| 741 | - g_browser_process->safe_browsing_service()); | ||
| 742 | - if (safe_browsing_service.get()) { | ||
| 743 | - auto pref_validation_delegate_impl = | ||
| 744 | - safe_browsing_service->CreatePreferenceValidationDelegate(this); | ||
| 745 | - if (pref_validation_delegate_impl) { | ||
| 746 | - mojo::MakeSelfOwnedReceiver( | ||
| 747 | - std::move(pref_validation_delegate_impl), | ||
| 748 | - pref_validation_delegate.InitWithNewPipeAndPassReceiver()); | ||
| 749 | - } | ||
| 750 | - } | ||
| 751 | |||
| 752 | prefs_ = | ||
| 753 | CreatePrefService(pref_registry_, CreateExtensionPrefStore(this, false), | ||
| 754 | --- chrome/browser/profiles/profiles_state.cc.orig | ||
| 755 | +++ chrome/browser/profiles/profiles_state.cc | ||
| 756 | @@ -259,9 +259,6 @@ void RemoveBrowsingDataForProfile(const | ||
| 757 | // The BrowsingDataRemover relies on many objects that aren't created in unit | ||
| 758 | // tests. Previously this code would depend on content::ResourceDispatcherHost | ||
| 759 | // but that's gone, so do a similar hack for now. | ||
| 760 | - if (!g_browser_process->safe_browsing_service()) | ||
| 761 | - return; | ||
| 762 | - | ||
| 763 | Profile* profile = | ||
| 764 | g_browser_process->profile_manager()->GetProfileByPath(profile_path); | ||
| 765 | if (!profile) | ||
| 766 | --- chrome/browser/safe_browsing/BUILD.gn.orig | ||
| 767 | +++ chrome/browser/safe_browsing/BUILD.gn | ||
| 768 | @@ -5,6 +5,7 @@ import("//components/safe_browsing/build | ||
| 769 | import("//extensions/buildflags/buildflags.gni") | ||
| 770 | |||
| 771 | static_library("safe_browsing") { | ||
| 772 | + if (false) { | ||
| 773 | sources = [ | ||
| 774 | "chrome_controller_client.cc", | ||
| 775 | "chrome_controller_client.h", | ||
| 776 | @@ -88,6 +89,7 @@ static_library("safe_browsing") { | ||
| 777 | "//extensions/browser", | ||
| 778 | ] | ||
| 779 | } | ||
| 780 | + } | ||
| 781 | |||
| 782 | if (safe_browsing_mode != 0) { | ||
| 783 | # "Safe Browsing Basic" files used for safe browsing in full mode | ||
| 784 | @@ -411,6 +413,7 @@ static_library("advanced_protection") { | ||
| 785 | } | ||
| 786 | |||
| 787 | source_set("metrics_collector") { | ||
| 788 | + if (false) { | ||
| 789 | sources = [ | ||
| 790 | "safe_browsing_metrics_collector_factory.cc", | ||
| 791 | "safe_browsing_metrics_collector_factory.h", | ||
| 792 | @@ -428,6 +431,7 @@ source_set("metrics_collector") { | ||
| 793 | "//components/safe_browsing/core/common:safe_browsing_prefs", | ||
| 794 | "//content/public/browser", | ||
| 795 | ] | ||
| 796 | + } | ||
| 797 | } | ||
| 798 | |||
| 799 | source_set("test_support") { | ||
| 800 | --- chrome/browser/ssl/security_state_tab_helper.cc.orig | ||
| 801 | +++ chrome/browser/ssl/security_state_tab_helper.cc | ||
| 802 | @@ -217,89 +217,6 @@ bool SecurityStateTabHelper::UsedPolicyI | ||
| 803 | |||
| 804 | security_state::MaliciousContentStatus | ||
| 805 | SecurityStateTabHelper::GetMaliciousContentStatus() const { | ||
| 806 | - content::NavigationEntry* entry = | ||
| 807 | - web_contents()->GetController().GetVisibleEntry(); | ||
| 808 | - if (!entry) | ||
| 809 | - return security_state::MALICIOUS_CONTENT_STATUS_NONE; | ||
| 810 | - safe_browsing::SafeBrowsingService* sb_service = | ||
| 811 | - g_browser_process->safe_browsing_service(); | ||
| 812 | - if (!sb_service) | ||
| 813 | - return security_state::MALICIOUS_CONTENT_STATUS_NONE; | ||
| 814 | - scoped_refptr<SafeBrowsingUIManager> sb_ui_manager = sb_service->ui_manager(); | ||
| 815 | - safe_browsing::SBThreatType threat_type; | ||
| 816 | - if (sb_ui_manager->IsUrlAllowlistedOrPendingForWebContents( | ||
| 817 | - entry->GetURL(), false, entry, web_contents(), false, &threat_type)) { | ||
| 818 | - switch (threat_type) { | ||
| 819 | - case safe_browsing::SB_THREAT_TYPE_UNUSED: | ||
| 820 | - case safe_browsing::SB_THREAT_TYPE_SAFE: | ||
| 821 | - case safe_browsing::SB_THREAT_TYPE_URL_PHISHING: | ||
| 822 | - case safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_PHISHING: | ||
| 823 | - return security_state::MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING; | ||
| 824 | - case safe_browsing::SB_THREAT_TYPE_URL_MALWARE: | ||
| 825 | - case safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_MALWARE: | ||
| 826 | - return security_state::MALICIOUS_CONTENT_STATUS_MALWARE; | ||
| 827 | - case safe_browsing::SB_THREAT_TYPE_URL_UNWANTED: | ||
| 828 | - return security_state::MALICIOUS_CONTENT_STATUS_UNWANTED_SOFTWARE; | ||
| 829 | - case safe_browsing::SB_THREAT_TYPE_SAVED_PASSWORD_REUSE: | ||
| 830 | -#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 831 | - return security_state::MALICIOUS_CONTENT_STATUS_SAVED_PASSWORD_REUSE; | ||
| 832 | -#endif | ||
| 833 | - case safe_browsing::SB_THREAT_TYPE_SIGNED_IN_SYNC_PASSWORD_REUSE: | ||
| 834 | -#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 835 | - if (safe_browsing::ChromePasswordProtectionService:: | ||
| 836 | - ShouldShowPasswordReusePageInfoBubble( | ||
| 837 | - web_contents(), PasswordType::PRIMARY_ACCOUNT_PASSWORD)) { | ||
| 838 | - return security_state:: | ||
| 839 | - MALICIOUS_CONTENT_STATUS_SIGNED_IN_SYNC_PASSWORD_REUSE; | ||
| 840 | - } | ||
| 841 | -#endif | ||
| 842 | - FALLTHROUGH; | ||
| 843 | - case safe_browsing::SB_THREAT_TYPE_SIGNED_IN_NON_SYNC_PASSWORD_REUSE: | ||
| 844 | -#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 845 | - if (safe_browsing::ChromePasswordProtectionService:: | ||
| 846 | - ShouldShowPasswordReusePageInfoBubble( | ||
| 847 | - web_contents(), PasswordType::OTHER_GAIA_PASSWORD)) { | ||
| 848 | - return security_state:: | ||
| 849 | - MALICIOUS_CONTENT_STATUS_SIGNED_IN_NON_SYNC_PASSWORD_REUSE; | ||
| 850 | - } | ||
| 851 | -#endif | ||
| 852 | - FALLTHROUGH; | ||
| 853 | - case safe_browsing::SB_THREAT_TYPE_ENTERPRISE_PASSWORD_REUSE: | ||
| 854 | -#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 855 | - if (safe_browsing::ChromePasswordProtectionService:: | ||
| 856 | - ShouldShowPasswordReusePageInfoBubble( | ||
| 857 | - web_contents(), PasswordType::ENTERPRISE_PASSWORD)) { | ||
| 858 | - return security_state:: | ||
| 859 | - MALICIOUS_CONTENT_STATUS_ENTERPRISE_PASSWORD_REUSE; | ||
| 860 | - } | ||
| 861 | -#endif | ||
| 862 | - // If user has already changed password or FULL_SAFE_BROWSING isn't | ||
| 863 | - // enabled, returns the regular social engineering content status. | ||
| 864 | - return security_state::MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING; | ||
| 865 | - case safe_browsing::SB_THREAT_TYPE_BILLING: | ||
| 866 | - return security_state::MALICIOUS_CONTENT_STATUS_BILLING; | ||
| 867 | - case safe_browsing:: | ||
| 868 | - DEPRECATED_SB_THREAT_TYPE_URL_PASSWORD_PROTECTION_PHISHING: | ||
| 869 | - case safe_browsing::SB_THREAT_TYPE_URL_BINARY_MALWARE: | ||
| 870 | - case safe_browsing::SB_THREAT_TYPE_EXTENSION: | ||
| 871 | - case safe_browsing::SB_THREAT_TYPE_BLOCKLISTED_RESOURCE: | ||
| 872 | - case safe_browsing::SB_THREAT_TYPE_API_ABUSE: | ||
| 873 | - case safe_browsing::SB_THREAT_TYPE_SUBRESOURCE_FILTER: | ||
| 874 | - case safe_browsing::SB_THREAT_TYPE_CSD_ALLOWLIST: | ||
| 875 | - case safe_browsing::SB_THREAT_TYPE_AD_SAMPLE: | ||
| 876 | - case safe_browsing::SB_THREAT_TYPE_BLOCKED_AD_POPUP: | ||
| 877 | - case safe_browsing::SB_THREAT_TYPE_BLOCKED_AD_REDIRECT: | ||
| 878 | - case safe_browsing::SB_THREAT_TYPE_SUSPICIOUS_SITE: | ||
| 879 | - case safe_browsing::SB_THREAT_TYPE_APK_DOWNLOAD: | ||
| 880 | - case safe_browsing::SB_THREAT_TYPE_HIGH_CONFIDENCE_ALLOWLIST: | ||
| 881 | - case safe_browsing::SB_THREAT_TYPE_ACCURACY_TIPS: | ||
| 882 | - // These threat types are not currently associated with | ||
| 883 | - // interstitials, and thus resources with these threat types are | ||
| 884 | - // not ever whitelisted or pending whitelisting. | ||
| 885 | - NOTREACHED(); | ||
| 886 | - break; | ||
| 887 | - } | ||
| 888 | - } | ||
| 889 | return security_state::MALICIOUS_CONTENT_STATUS_NONE; | ||
| 890 | } | ||
| 891 | |||
| 892 | --- chrome/browser/ui/BUILD.gn.orig | ||
| 893 | +++ chrome/browser/ui/BUILD.gn | ||
| 894 | @@ -3946,7 +3946,6 @@ static_library("ui") { | ||
| 895 | "views/device_chooser_content_view.h", | ||
| 896 | "views/devtools_process_observer.cc", | ||
| 897 | "views/devtools_process_observer.h", | ||
| 898 | - "views/download/download_danger_prompt_views.cc", | ||
| 899 | "views/download/download_in_progress_dialog_view.cc", | ||
| 900 | "views/download/download_in_progress_dialog_view.h", | ||
| 901 | "views/download/download_item_view.cc", | ||
| 902 | --- chrome/browser/ui/tab_helpers.cc.orig | ||
| 903 | +++ chrome/browser/ui/tab_helpers.cc | ||
| 904 | @@ -330,16 +330,6 @@ void TabHelpers::AttachTabHelpers(WebCon | ||
| 905 | // See https://crbug.com/910288. | ||
| 906 | resource_coordinator::ResourceCoordinatorTabHelper::CreateForWebContents( | ||
| 907 | web_contents); | ||
| 908 | - safe_browsing::SafeBrowsingNavigationObserver::MaybeCreateForWebContents( | ||
| 909 | - web_contents, HostContentSettingsMapFactory::GetForProfile(profile), | ||
| 910 | - safe_browsing::SafeBrowsingNavigationObserverManagerFactory:: | ||
| 911 | - GetForBrowserContext(profile), | ||
| 912 | - profile->GetPrefs(), g_browser_process->safe_browsing_service()); | ||
| 913 | - safe_browsing::SafeBrowsingTabObserver::CreateForWebContents( | ||
| 914 | - web_contents, | ||
| 915 | - std::make_unique<safe_browsing::ChromeSafeBrowsingTabObserverDelegate>()); | ||
| 916 | - safe_browsing::TriggerCreator::MaybeCreateTriggersForWebContents( | ||
| 917 | - profile, web_contents); | ||
| 918 | ReputationWebContentsObserver::CreateForWebContents(web_contents); | ||
| 919 | SearchEngineTabHelper::CreateForWebContents(web_contents); | ||
| 920 | SecurityStateTabHelper::CreateForWebContents(web_contents); | ||
| 921 | --- chrome/browser/ui/webui/downloads/downloads_dom_handler.cc.orig | ||
| 922 | +++ chrome/browser/ui/webui/downloads/downloads_dom_handler.cc | ||
| 923 | @@ -23,7 +23,6 @@ | ||
| 924 | #include "base/threading/thread.h" | ||
| 925 | #include "base/values.h" | ||
| 926 | #include "chrome/browser/browser_process.h" | ||
| 927 | -#include "chrome/browser/download/download_danger_prompt.h" | ||
| 928 | #include "chrome/browser/download/download_history.h" | ||
| 929 | #include "chrome/browser/download/download_item_model.h" | ||
| 930 | #include "chrome/browser/download/download_prefs.h" | ||
| 931 | @@ -171,9 +170,6 @@ void DownloadsDOMHandler::SaveDangerousR | ||
| 932 | } | ||
| 933 | |||
| 934 | CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_SAVE_DANGEROUS); | ||
| 935 | - download::DownloadItem* file = GetDownloadByStringId(id); | ||
| 936 | - if (file) | ||
| 937 | - ShowDangerPrompt(file); | ||
| 938 | } | ||
| 939 | |||
| 940 | void DownloadsDOMHandler::AcceptIncognitoWarning(const std::string& id) { | ||
| 941 | @@ -325,12 +321,6 @@ void DownloadsDOMHandler::RemoveDownload | ||
| 942 | IdSet ids; | ||
| 943 | |||
| 944 | for (auto* download : to_remove) { | ||
| 945 | - if (download->IsDangerous() || download->IsMixedContent()) { | ||
| 946 | - // Don't allow users to revive dangerous downloads; just nuke 'em. | ||
| 947 | - download->Remove(); | ||
| 948 | - continue; | ||
| 949 | - } | ||
| 950 | - | ||
| 951 | DownloadItemModel item_model(download); | ||
| 952 | if (!item_model.ShouldShowInShelf() || | ||
| 953 | download->GetState() == download::DownloadItem::IN_PROGRESS) { | ||
| 954 | @@ -404,44 +394,6 @@ void DownloadsDOMHandler::FinalizeRemova | ||
| 955 | } | ||
| 956 | } | ||
| 957 | |||
| 958 | -void DownloadsDOMHandler::ShowDangerPrompt( | ||
| 959 | - download::DownloadItem* dangerous_item) { | ||
| 960 | - DownloadDangerPrompt* danger_prompt = DownloadDangerPrompt::Create( | ||
| 961 | - dangerous_item, GetWebUIWebContents(), false, | ||
| 962 | - base::BindOnce(&DownloadsDOMHandler::DangerPromptDone, | ||
| 963 | - weak_ptr_factory_.GetWeakPtr(), dangerous_item->GetId())); | ||
| 964 | - // danger_prompt will delete itself. | ||
| 965 | - DCHECK(danger_prompt); | ||
| 966 | -} | ||
| 967 | - | ||
| 968 | -void DownloadsDOMHandler::DangerPromptDone( | ||
| 969 | - int download_id, | ||
| 970 | - DownloadDangerPrompt::Action action) { | ||
| 971 | - if (action != DownloadDangerPrompt::ACCEPT) | ||
| 972 | - return; | ||
| 973 | - download::DownloadItem* item = NULL; | ||
| 974 | - if (GetMainNotifierManager()) | ||
| 975 | - item = GetMainNotifierManager()->GetDownload(download_id); | ||
| 976 | - if (!item && GetOriginalNotifierManager()) | ||
| 977 | - item = GetOriginalNotifierManager()->GetDownload(download_id); | ||
| 978 | - if (!item || item->IsDone()) | ||
| 979 | - return; | ||
| 980 | - CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_SAVE_DANGEROUS); | ||
| 981 | - | ||
| 982 | - // If a download is mixed content, validate that first. Is most cases, mixed | ||
| 983 | - // content warnings will occur first, but in the worst case scenario, we show | ||
| 984 | - // a dangerous warning twice. That's better than showing a mixed content | ||
| 985 | - // warning, then dismissing the dangerous download warning. Since mixed | ||
| 986 | - // content downloads triggering the UI are temporary and rare to begin with, | ||
| 987 | - // this should very rarely occur. | ||
| 988 | - if (item->IsMixedContent()) { | ||
| 989 | - item->ValidateMixedContentDownload(); | ||
| 990 | - return; | ||
| 991 | - } | ||
| 992 | - | ||
| 993 | - item->ValidateDangerousDownload(); | ||
| 994 | -} | ||
| 995 | - | ||
| 996 | bool DownloadsDOMHandler::IsDeletingHistoryAllowed() { | ||
| 997 | content::DownloadManager* manager = GetMainNotifierManager(); | ||
| 998 | return manager && | ||
| 999 | --- chrome/browser/ui/webui/downloads/downloads_dom_handler.h.orig | ||
| 1000 | +++ chrome/browser/ui/webui/downloads/downloads_dom_handler.h | ||
| 1001 | @@ -12,7 +12,6 @@ | ||
| 1002 | |||
| 1003 | #include "base/macros.h" | ||
| 1004 | #include "base/memory/weak_ptr.h" | ||
| 1005 | -#include "chrome/browser/download/download_danger_prompt.h" | ||
| 1006 | #include "chrome/browser/ui/webui/downloads/downloads.mojom-forward.h" | ||
| 1007 | #include "chrome/browser/ui/webui/downloads/downloads_list_tracker.h" | ||
| 1008 | #include "content/public/browser/web_contents_observer.h" | ||
| 1009 | @@ -94,18 +93,6 @@ class DownloadsDOMHandler : public conte | ||
| 1010 | // null-checking |original_notifier_|. | ||
| 1011 | content::DownloadManager* GetOriginalNotifierManager() const; | ||
| 1012 | |||
| 1013 | - // Displays a native prompt asking the user for confirmation after accepting | ||
| 1014 | - // the dangerous download specified by |dangerous|. The function returns | ||
| 1015 | - // immediately, and will invoke DangerPromptAccepted() asynchronously if the | ||
| 1016 | - // user accepts the dangerous download. The native prompt will observe | ||
| 1017 | - // |dangerous| until either the dialog is dismissed or |dangerous| is no | ||
| 1018 | - // longer an in-progress dangerous download. | ||
| 1019 | - virtual void ShowDangerPrompt(download::DownloadItem* dangerous); | ||
| 1020 | - | ||
| 1021 | - // Conveys danger acceptance from the DownloadDangerPrompt to the | ||
| 1022 | - // DownloadItem. | ||
| 1023 | - void DangerPromptDone(int download_id, DownloadDangerPrompt::Action action); | ||
| 1024 | - | ||
| 1025 | // Returns true if the records of any downloaded items are allowed (and able) | ||
| 1026 | // to be deleted. | ||
| 1027 | bool IsDeletingHistoryAllowed(); | ||
| 1028 | --- chrome/browser/ui/webui/interstitials/interstitial_ui.cc.orig | ||
| 1029 | +++ chrome/browser/ui/webui/interstitials/interstitial_ui.cc | ||
| 1030 | @@ -281,116 +281,6 @@ CreateHttpsOnlyModePage(content::WebCont | ||
| 1031 | request_url)); | ||
| 1032 | } | ||
| 1033 | |||
| 1034 | -std::unique_ptr<safe_browsing::SafeBrowsingBlockingPage> | ||
| 1035 | -CreateSafeBrowsingBlockingPage(content::WebContents* web_contents) { | ||
| 1036 | - safe_browsing::SBThreatType threat_type = | ||
| 1037 | - safe_browsing::SB_THREAT_TYPE_URL_MALWARE; | ||
| 1038 | - GURL request_url("http://example.com"); | ||
| 1039 | - std::string url_param; | ||
| 1040 | - if (net::GetValueForKeyInQuery(web_contents->GetURL(), "url", &url_param)) { | ||
| 1041 | - if (GURL(url_param).is_valid()) { | ||
| 1042 | - request_url = GURL(url_param); | ||
| 1043 | - } | ||
| 1044 | - } | ||
| 1045 | - GURL main_frame_url(request_url); | ||
| 1046 | - // TODO(mattm): add flag to change main_frame_url or add dedicated flag to | ||
| 1047 | - // test subresource interstitials. | ||
| 1048 | - std::string type_param; | ||
| 1049 | - if (net::GetValueForKeyInQuery(web_contents->GetURL(), "type", &type_param)) { | ||
| 1050 | - if (type_param == "malware") { | ||
| 1051 | - threat_type = safe_browsing::SB_THREAT_TYPE_URL_MALWARE; | ||
| 1052 | - } else if (type_param == "phishing") { | ||
| 1053 | - threat_type = safe_browsing::SB_THREAT_TYPE_URL_PHISHING; | ||
| 1054 | - } else if (type_param == "unwanted") { | ||
| 1055 | - threat_type = safe_browsing::SB_THREAT_TYPE_URL_UNWANTED; | ||
| 1056 | - } else if (type_param == "clientside_malware") { | ||
| 1057 | - threat_type = safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_MALWARE; | ||
| 1058 | - } else if (type_param == "clientside_phishing") { | ||
| 1059 | - threat_type = safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_PHISHING; | ||
| 1060 | - } else if (type_param == "billing") { | ||
| 1061 | - threat_type = safe_browsing::SB_THREAT_TYPE_BILLING; | ||
| 1062 | - } | ||
| 1063 | - } | ||
| 1064 | - const content::GlobalRenderFrameHostId primary_main_frame_id = | ||
| 1065 | - web_contents->GetMainFrame()->GetGlobalId(); | ||
| 1066 | - safe_browsing::SafeBrowsingBlockingPage::UnsafeResource resource; | ||
| 1067 | - resource.url = request_url; | ||
| 1068 | - resource.is_subresource = request_url != main_frame_url; | ||
| 1069 | - resource.is_subframe = false; | ||
| 1070 | - resource.threat_type = threat_type; | ||
| 1071 | - resource.render_process_id = primary_main_frame_id.child_id; | ||
| 1072 | - resource.render_frame_id = primary_main_frame_id.frame_routing_id; | ||
| 1073 | - resource.threat_source = g_browser_process->safe_browsing_service() | ||
| 1074 | - ->database_manager() | ||
| 1075 | - ->GetThreatSource(); | ||
| 1076 | - | ||
| 1077 | - // Normally safebrowsing interstitial types which block the main page load | ||
| 1078 | - // (SB_THREAT_TYPE_URL_MALWARE, SB_THREAT_TYPE_URL_PHISHING, and | ||
| 1079 | - // SB_THREAT_TYPE_URL_UNWANTED on main-frame loads) would expect there to be a | ||
| 1080 | - // pending navigation when the SafeBrowsingBlockingPage is created. This demo | ||
| 1081 | - // creates a SafeBrowsingBlockingPage but does not actually show a real | ||
| 1082 | - // interstitial. Instead it extracts the html and displays it manually, so the | ||
| 1083 | - // parts which depend on the NavigationEntry are not hit. | ||
| 1084 | - auto* ui_manager = | ||
| 1085 | - g_browser_process->safe_browsing_service()->ui_manager().get(); | ||
| 1086 | - return base::WrapUnique<safe_browsing::SafeBrowsingBlockingPage>( | ||
| 1087 | - ui_manager->blocking_page_factory()->CreateSafeBrowsingPage( | ||
| 1088 | - ui_manager, web_contents, main_frame_url, {resource}, true)); | ||
| 1089 | -} | ||
| 1090 | - | ||
| 1091 | -std::unique_ptr<TestSafeBrowsingBlockingPageQuiet> | ||
| 1092 | -CreateSafeBrowsingQuietBlockingPage(content::WebContents* web_contents) { | ||
| 1093 | - safe_browsing::SBThreatType threat_type = | ||
| 1094 | - safe_browsing::SB_THREAT_TYPE_URL_MALWARE; | ||
| 1095 | - GURL request_url("http://example.com"); | ||
| 1096 | - std::string url_param; | ||
| 1097 | - if (net::GetValueForKeyInQuery(web_contents->GetURL(), "url", &url_param)) { | ||
| 1098 | - if (GURL(url_param).is_valid()) | ||
| 1099 | - request_url = GURL(url_param); | ||
| 1100 | - } | ||
| 1101 | - GURL main_frame_url(request_url); | ||
| 1102 | - std::string type_param; | ||
| 1103 | - bool is_giant_webview = false; | ||
| 1104 | - if (net::GetValueForKeyInQuery(web_contents->GetURL(), "type", &type_param)) { | ||
| 1105 | - if (type_param == "malware") { | ||
| 1106 | - threat_type = safe_browsing::SB_THREAT_TYPE_URL_MALWARE; | ||
| 1107 | - } else if (type_param == "phishing") { | ||
| 1108 | - threat_type = safe_browsing::SB_THREAT_TYPE_URL_PHISHING; | ||
| 1109 | - } else if (type_param == "unwanted") { | ||
| 1110 | - threat_type = safe_browsing::SB_THREAT_TYPE_URL_UNWANTED; | ||
| 1111 | - } else if (type_param == "billing") { | ||
| 1112 | - threat_type = safe_browsing::SB_THREAT_TYPE_BILLING; | ||
| 1113 | - } else if (type_param == "giant") { | ||
| 1114 | - threat_type = safe_browsing::SB_THREAT_TYPE_URL_MALWARE; | ||
| 1115 | - is_giant_webview = true; | ||
| 1116 | - } | ||
| 1117 | - } | ||
| 1118 | - const content::GlobalRenderFrameHostId primary_main_frame_id = | ||
| 1119 | - web_contents->GetMainFrame()->GetGlobalId(); | ||
| 1120 | - safe_browsing::SafeBrowsingBlockingPage::UnsafeResource resource; | ||
| 1121 | - resource.url = request_url; | ||
| 1122 | - resource.is_subresource = request_url != main_frame_url; | ||
| 1123 | - resource.is_subframe = false; | ||
| 1124 | - resource.threat_type = threat_type; | ||
| 1125 | - resource.render_process_id = primary_main_frame_id.child_id; | ||
| 1126 | - resource.render_frame_id = primary_main_frame_id.frame_routing_id; | ||
| 1127 | - resource.threat_source = g_browser_process->safe_browsing_service() | ||
| 1128 | - ->database_manager() | ||
| 1129 | - ->GetThreatSource(); | ||
| 1130 | - | ||
| 1131 | - // Normally safebrowsing interstitial types which block the main page load | ||
| 1132 | - // (SB_THREAT_TYPE_URL_MALWARE, SB_THREAT_TYPE_URL_PHISHING, and | ||
| 1133 | - // SB_THREAT_TYPE_URL_UNWANTED on main-frame loads) would expect there to be a | ||
| 1134 | - // pending navigation when the SafeBrowsingBlockingPage is created. This demo | ||
| 1135 | - // creates a SafeBrowsingBlockingPage but does not actually show a real | ||
| 1136 | - // interstitial. Instead it extracts the html and displays it manually, so the | ||
| 1137 | - // parts which depend on the NavigationEntry are not hit. | ||
| 1138 | - return base::WrapUnique<TestSafeBrowsingBlockingPageQuiet>( | ||
| 1139 | - TestSafeBrowsingBlockingPageQuiet::CreateBlockingPage( | ||
| 1140 | - g_browser_process->safe_browsing_service()->ui_manager().get(), | ||
| 1141 | - web_contents, main_frame_url, resource, is_giant_webview)); | ||
| 1142 | -} | ||
| 1143 | - | ||
| 1144 | #if BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION) | ||
| 1145 | std::unique_ptr<CaptivePortalBlockingPage> CreateCaptivePortalBlockingPage( | ||
| 1146 | content::WebContents* web_contents) { | ||
| 1147 | @@ -507,8 +397,6 @@ void InterstitialHTMLSource::StartDataRe | ||
| 1148 | interstitial_delegate = CreateBlockedInterceptionBlockingPage(web_contents); | ||
| 1149 | } else if (path_without_query == "/legacy-tls") { | ||
| 1150 | interstitial_delegate = CreateLegacyTLSBlockingPage(web_contents); | ||
| 1151 | - } else if (path_without_query == "/safebrowsing") { | ||
| 1152 | - interstitial_delegate = CreateSafeBrowsingBlockingPage(web_contents); | ||
| 1153 | } else if (path_without_query == "/clock") { | ||
| 1154 | interstitial_delegate = CreateBadClockBlockingPage(web_contents); | ||
| 1155 | } else if (path_without_query == "/lookalike") { | ||
| 1156 | @@ -525,16 +413,12 @@ void InterstitialHTMLSource::StartDataRe | ||
| 1157 | interstitial_delegate = CreateHttpsOnlyModePage(web_contents); | ||
| 1158 | } | ||
| 1159 | |||
| 1160 | - if (path_without_query == "/quietsafebrowsing") { | ||
| 1161 | - std::unique_ptr<TestSafeBrowsingBlockingPageQuiet> blocking_page = | ||
| 1162 | - CreateSafeBrowsingQuietBlockingPage(web_contents); | ||
| 1163 | - html = blocking_page->GetHTML(); | ||
| 1164 | - interstitial_delegate = std::move(blocking_page); | ||
| 1165 | #if BUILDFLAG(ENABLE_SUPERVISED_USERS) | ||
| 1166 | - } else if (path_without_query == "/supervised_user") { | ||
| 1167 | + if (path_without_query == "/supervised_user") { | ||
| 1168 | html = GetSupervisedUserInterstitialHTML(path); | ||
| 1169 | + } else | ||
| 1170 | #endif | ||
| 1171 | - } else if (interstitial_delegate.get()) { | ||
| 1172 | + if (interstitial_delegate.get()) { | ||
| 1173 | html = interstitial_delegate.get()->GetHTMLContents(); | ||
| 1174 | } else { | ||
| 1175 | html = ui::ResourceBundle::GetSharedInstance().LoadDataResourceString( | ||
| 1176 | --- chrome/renderer/chrome_content_renderer_client.cc.orig | ||
| 1177 | +++ chrome/renderer/chrome_content_renderer_client.cc | ||
| 1178 | @@ -97,7 +97,6 @@ | ||
| 1179 | #include "components/page_load_metrics/renderer/metrics_render_frame_observer.h" | ||
| 1180 | #include "components/paint_preview/buildflags/buildflags.h" | ||
| 1181 | #include "components/safe_browsing/buildflags.h" | ||
| 1182 | -#include "components/safe_browsing/content/renderer/threat_dom_details.h" | ||
| 1183 | #include "components/spellcheck/spellcheck_buildflags.h" | ||
| 1184 | #include "components/subresource_filter/content/renderer/subresource_filter_agent.h" | ||
| 1185 | #include "components/subresource_filter/content/renderer/unverified_ruleset_dealer.h" | ||
| 1186 | --- components/security_interstitials/content/cert_report_helper.cc.orig | ||
| 1187 | +++ components/security_interstitials/content/cert_report_helper.cc | ||
| 1188 | @@ -177,7 +177,6 @@ void CertReportHelper::FinishCertCollect | ||
| 1189 | return; | ||
| 1190 | } | ||
| 1191 | |||
| 1192 | - ssl_cert_reporter_->ReportInvalidCertificateChain(serialized_report); | ||
| 1193 | } | ||
| 1194 | |||
| 1195 | bool CertReportHelper::ShouldShowCertificateReporterCheckbox() { | ||
diff --git a/www/chromium-uc/patches/core/inox-patchset/0003-disable-autofill-download-manager.patch b/www/chromium-uc/patches/core/inox-patchset/0003-disable-autofill-download-manager.patch new file mode 100644 index 0000000..b3f1614 --- /dev/null +++ b/www/chromium-uc/patches/core/inox-patchset/0003-disable-autofill-download-manager.patch | |||
| @@ -0,0 +1,99 @@ | |||
| 1 | --- components/autofill/core/browser/autofill_download_manager.cc.orig | ||
| 2 | +++ components/autofill/core/browser/autofill_download_manager.cc | ||
| 3 | @@ -824,96 +824,6 @@ std::tuple<GURL, std::string> AutofillDo | ||
| 4 | } | ||
| 5 | |||
| 6 | bool AutofillDownloadManager::StartRequest(FormRequestData request_data) { | ||
| 7 | - scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory = | ||
| 8 | - driver_->GetURLLoaderFactory(); | ||
| 9 | - DCHECK(url_loader_factory); | ||
| 10 | - | ||
| 11 | - // Get the URL and method to use for this request. | ||
| 12 | - std::string method; | ||
| 13 | - GURL request_url; | ||
| 14 | - std::tie(request_url, method) = GetRequestURLAndMethod(request_data); | ||
| 15 | - | ||
| 16 | - // Track the URL length for GET queries because the URL length can be in the | ||
| 17 | - // thousands when rich metadata is enabled. | ||
| 18 | - if (request_data.request_type == AutofillDownloadManager::REQUEST_QUERY && | ||
| 19 | - method == "GET") { | ||
| 20 | - UMA_HISTOGRAM_COUNTS_100000("Autofill.Query.GetUrlLength", | ||
| 21 | - request_url.spec().length()); | ||
| 22 | - } | ||
| 23 | - | ||
| 24 | - auto resource_request = std::make_unique<network::ResourceRequest>(); | ||
| 25 | - resource_request->url = request_url; | ||
| 26 | - resource_request->credentials_mode = network::mojom::CredentialsMode::kOmit; | ||
| 27 | - resource_request->method = method; | ||
| 28 | - | ||
| 29 | - // On iOS we have a single, shared URLLoaderFactory provided by BrowserState. | ||
| 30 | - // As it is shared, it is not trusted and we cannot assign trusted_params | ||
| 31 | - // to the network request. | ||
| 32 | -#if !defined(OS_IOS) | ||
| 33 | - // Do not call IsolationInfo() for REQUEST_UPLOADs because Password Manager | ||
| 34 | - // uploads when RenderFrameHostImpl::DidCommitNavigation() is called, in which | ||
| 35 | - // case IsolationInfo() may crash because there is no committing | ||
| 36 | - // NavigationRequest. This is safe because no information about the response | ||
| 37 | - // is passed to the renderer, or is otherwise visible to a page. | ||
| 38 | - // crbug/1176635#c22 | ||
| 39 | - if (request_data.request_type != AutofillDownloadManager::REQUEST_UPLOAD) { | ||
| 40 | - resource_request->trusted_params = | ||
| 41 | - network::ResourceRequest::TrustedParams(); | ||
| 42 | - resource_request->trusted_params->isolation_info = driver_->IsolationInfo(); | ||
| 43 | - } | ||
| 44 | -#endif | ||
| 45 | - | ||
| 46 | - // Add Chrome experiment state to the request headers. | ||
| 47 | - variations::AppendVariationsHeaderUnknownSignedIn( | ||
| 48 | - request_url, | ||
| 49 | - driver_->IsIncognito() ? variations::InIncognito::kYes | ||
| 50 | - : variations::InIncognito::kNo, | ||
| 51 | - resource_request.get()); | ||
| 52 | - | ||
| 53 | - // Set headers specific to the API. | ||
| 54 | - // Encode response serialized proto in base64 for safety. | ||
| 55 | - resource_request->headers.SetHeader(kGoogEncodeResponseIfExecutable, | ||
| 56 | - "base64"); | ||
| 57 | - | ||
| 58 | - // Put API key in request's header if a key exists, and the endpoint is | ||
| 59 | - // trusted by Google. | ||
| 60 | - if (!api_key_.empty() && request_url.SchemeIs(url::kHttpsScheme) && | ||
| 61 | - google_util::IsGoogleAssociatedDomainUrl(request_url)) { | ||
| 62 | - resource_request->headers.SetHeader(kGoogApiKey, api_key_); | ||
| 63 | - } | ||
| 64 | - | ||
| 65 | - auto simple_loader = network::SimpleURLLoader::Create( | ||
| 66 | - std::move(resource_request), | ||
| 67 | - GetNetworkTrafficAnnotation(request_data.request_type)); | ||
| 68 | - | ||
| 69 | - // This allows reading the error message within the API response when status | ||
| 70 | - // is not 200 (e.g., 400). Otherwise, URL loader will not give any content in | ||
| 71 | - // the response when there is a failure, which makes debugging hard. | ||
| 72 | - simple_loader->SetAllowHttpErrorResults(true); | ||
| 73 | - | ||
| 74 | - if (method == "POST") { | ||
| 75 | - const std::string content_type = "application/x-protobuf"; | ||
| 76 | - std::string payload; | ||
| 77 | - if (!GetAPIBodyPayload(request_data.payload, request_data.request_type, | ||
| 78 | - &payload)) { | ||
| 79 | - return false; | ||
| 80 | - } | ||
| 81 | - | ||
| 82 | - // Attach payload data and add data format header. | ||
| 83 | - simple_loader->AttachStringForUpload(payload, content_type); | ||
| 84 | - } | ||
| 85 | - | ||
| 86 | - // Transfer ownership of the loader into url_loaders_. Temporarily hang | ||
| 87 | - // onto the raw pointer to use it as a key and to kick off the request; | ||
| 88 | - // transferring ownership (std::move) invalidates the |simple_loader| | ||
| 89 | - // variable. | ||
| 90 | - auto* raw_simple_loader = simple_loader.get(); | ||
| 91 | - url_loaders_.push_back(std::move(simple_loader)); | ||
| 92 | - raw_simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( | ||
| 93 | - url_loader_factory.get(), | ||
| 94 | - base::BindOnce(&AutofillDownloadManager::OnSimpleLoaderComplete, | ||
| 95 | - base::Unretained(this), std::move(--url_loaders_.end()), | ||
| 96 | - std::move(request_data), AutofillTickClock::NowTicks())); | ||
| 97 | return true; | ||
| 98 | } | ||
| 99 | |||
diff --git a/www/chromium-uc/patches/core/inox-patchset/0005-disable-default-extensions.patch b/www/chromium-uc/patches/core/inox-patchset/0005-disable-default-extensions.patch new file mode 100644 index 0000000..894d468 --- /dev/null +++ b/www/chromium-uc/patches/core/inox-patchset/0005-disable-default-extensions.patch | |||
| @@ -0,0 +1,100 @@ | |||
| 1 | --- chrome/browser/extensions/component_extensions_allowlist/allowlist.cc.orig | ||
| 2 | +++ chrome/browser/extensions/component_extensions_allowlist/allowlist.cc | ||
| 3 | @@ -28,7 +28,6 @@ namespace extensions { | ||
| 4 | |||
| 5 | bool IsComponentExtensionAllowlisted(const std::string& extension_id) { | ||
| 6 | const char* const kAllowed[] = { | ||
| 7 | - extension_misc::kInAppPaymentsSupportAppId, | ||
| 8 | extension_misc::kPdfExtensionId, | ||
| 9 | #if defined(OS_CHROMEOS) | ||
| 10 | extension_misc::kAssessmentAssistantExtensionId, | ||
| 11 | --- chrome/browser/extensions/component_loader.cc.orig | ||
| 12 | +++ chrome/browser/extensions/component_loader.cc | ||
| 13 | @@ -354,11 +354,6 @@ void ComponentLoader::AddWebStoreApp() { | ||
| 14 | if (!IsNormalSession()) | ||
| 15 | return; | ||
| 16 | #endif | ||
| 17 | - | ||
| 18 | - AddWithNameAndDescription( | ||
| 19 | - IDR_WEBSTORE_MANIFEST, base::FilePath(FILE_PATH_LITERAL("web_store")), | ||
| 20 | - l10n_util::GetStringUTF8(IDS_WEBSTORE_NAME_STORE), | ||
| 21 | - l10n_util::GetStringUTF8(IDS_WEBSTORE_APP_DESCRIPTION)); | ||
| 22 | } | ||
| 23 | |||
| 24 | #if BUILDFLAG(IS_CHROMEOS_ASH) | ||
| 25 | @@ -495,18 +490,6 @@ void ComponentLoader::AddDefaultComponen | ||
| 26 | AddHangoutServicesExtension(); | ||
| 27 | #endif // BUILDFLAG(ENABLE_HANGOUT_SERVICES_EXTENSION) | ||
| 28 | |||
| 29 | - bool install_feedback = enable_background_extensions_during_testing; | ||
| 30 | -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) | ||
| 31 | - install_feedback = true; | ||
| 32 | -#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING) | ||
| 33 | - if (install_feedback) { | ||
| 34 | - AddWithNameAndDescription( | ||
| 35 | - IDR_FEEDBACK_MANIFEST, base::FilePath(FILE_PATH_LITERAL("feedback")), | ||
| 36 | - l10n_util::GetStringUTF8(IDS_FEEDBACK_REPORT_APP_TITLE), | ||
| 37 | - // Description string | ||
| 38 | - l10n_util::GetStringUTF8(IDS_FEEDBACK_REPORT_PAGE_TITLE)); | ||
| 39 | - } | ||
| 40 | - | ||
| 41 | #if BUILDFLAG(IS_CHROMEOS_ASH) | ||
| 42 | if (command_line->HasSwitch(switches::kLoadGuestModeTestExtension)) { | ||
| 43 | base::FilePath path = base::FilePath(command_line->GetSwitchValueASCII( | ||
| 44 | --- chrome/browser/extensions/external_component_loader.cc.orig | ||
| 45 | +++ chrome/browser/extensions/external_component_loader.cc | ||
| 46 | @@ -30,9 +30,6 @@ ExternalComponentLoader::~ExternalCompon | ||
| 47 | |||
| 48 | void ExternalComponentLoader::StartLoading() { | ||
| 49 | auto prefs = std::make_unique<base::DictionaryValue>(); | ||
| 50 | -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) | ||
| 51 | - AddExternalExtension(extension_misc::kInAppPaymentsSupportAppId, prefs.get()); | ||
| 52 | -#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING) | ||
| 53 | |||
| 54 | #if defined(OS_CHROMEOS) | ||
| 55 | { | ||
| 56 | --- chrome/browser/extensions/webstore_installer.cc.orig | ||
| 57 | +++ chrome/browser/extensions/webstore_installer.cc | ||
| 58 | @@ -555,20 +555,6 @@ void WebstoreInstaller::DownloadNextPend | ||
| 59 | void WebstoreInstaller::DownloadCrx( | ||
| 60 | const std::string& extension_id, | ||
| 61 | InstallSource source) { | ||
| 62 | - download_url_ = GetWebstoreInstallURL(extension_id, source); | ||
| 63 | - MaybeAppendAuthUserParameter(approval_->authuser, &download_url_); | ||
| 64 | - | ||
| 65 | - base::FilePath user_data_dir; | ||
| 66 | - base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); | ||
| 67 | - base::FilePath download_path = user_data_dir.Append(kWebstoreDownloadFolder); | ||
| 68 | - | ||
| 69 | - base::FilePath download_directory(g_download_directory_for_tests ? | ||
| 70 | - *g_download_directory_for_tests : download_path); | ||
| 71 | - | ||
| 72 | - base::PostTaskAndReplyWithResult( | ||
| 73 | - GetExtensionFileTaskRunner().get(), FROM_HERE, | ||
| 74 | - base::BindOnce(&GetDownloadFilePath, download_directory, extension_id), | ||
| 75 | - base::BindOnce(&WebstoreInstaller::StartDownload, this, extension_id)); | ||
| 76 | } | ||
| 77 | |||
| 78 | // http://crbug.com/165634 | ||
| 79 | @@ -712,21 +698,6 @@ void WebstoreInstaller::UpdateDownloadPr | ||
| 80 | void WebstoreInstaller::StartCrxInstaller(const DownloadItem& download) { | ||
| 81 | DCHECK_CURRENTLY_ON(BrowserThread::UI); | ||
| 82 | DCHECK(!crx_installer_.get()); | ||
| 83 | - | ||
| 84 | - ExtensionService* service = ExtensionSystem::Get(profile_)-> | ||
| 85 | - extension_service(); | ||
| 86 | - CHECK(service); | ||
| 87 | - | ||
| 88 | - const Approval* approval = GetAssociatedApproval(download); | ||
| 89 | - DCHECK(approval); | ||
| 90 | - | ||
| 91 | - crx_installer_ = download_crx_util::CreateCrxInstaller(profile_, download); | ||
| 92 | - | ||
| 93 | - crx_installer_->set_expected_id(approval->extension_id); | ||
| 94 | - crx_installer_->set_is_gallery_install(true); | ||
| 95 | - crx_installer_->set_allow_silent_install(true); | ||
| 96 | - | ||
| 97 | - crx_installer_->InstallCrx(download.GetFullPath()); | ||
| 98 | } | ||
| 99 | |||
| 100 | void WebstoreInstaller::ReportFailure(const std::string& error, | ||
diff --git a/www/chromium-uc/patches/core/inox-patchset/0007-disable-web-resource-service.patch b/www/chromium-uc/patches/core/inox-patchset/0007-disable-web-resource-service.patch new file mode 100644 index 0000000..ad9e012 --- /dev/null +++ b/www/chromium-uc/patches/core/inox-patchset/0007-disable-web-resource-service.patch | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | --- components/web_resource/web_resource_service.cc.orig | ||
| 2 | +++ components/web_resource/web_resource_service.cc | ||
| 3 | @@ -120,44 +120,7 @@ bool WebResourceService::GetFetchSchedul | ||
| 4 | // Initializes the fetching of data from the resource server. Data | ||
| 5 | // load calls OnSimpleLoaderComplete. | ||
| 6 | void WebResourceService::StartFetch() { | ||
| 7 | - // Set to false so that next fetch can be scheduled after this fetch or | ||
| 8 | - // if we receive notification that resource is allowed. | ||
| 9 | - fetch_scheduled_ = false; | ||
| 10 | - // Check whether fetching is allowed. | ||
| 11 | - if (!resource_request_allowed_notifier_->ResourceRequestsAllowed()) | ||
| 12 | - return; | ||
| 13 | - | ||
| 14 | - // First, put our next cache load on the MessageLoop. | ||
| 15 | - ScheduleFetch(cache_update_delay_ms_); | ||
| 16 | - | ||
| 17 | - // Set cache update time in preferences. | ||
| 18 | - prefs_->SetString(last_update_time_pref_name_, | ||
| 19 | - base::NumberToString(base::Time::Now().ToDoubleT())); | ||
| 20 | - | ||
| 21 | - // If we are still fetching data, exit. | ||
| 22 | - if (in_fetch_) | ||
| 23 | - return; | ||
| 24 | - in_fetch_ = true; | ||
| 25 | - | ||
| 26 | - GURL web_resource_server = | ||
| 27 | - application_locale_.empty() | ||
| 28 | - ? web_resource_server_ | ||
| 29 | - : google_util::AppendGoogleLocaleParam(web_resource_server_, | ||
| 30 | - application_locale_); | ||
| 31 | - | ||
| 32 | - DVLOG(1) << "WebResourceService StartFetch " << web_resource_server; | ||
| 33 | - auto resource_request = std::make_unique<network::ResourceRequest>(); | ||
| 34 | - resource_request->url = web_resource_server; | ||
| 35 | - // Do not let url fetcher affect existing state in system context | ||
| 36 | - // (by setting cookies, for example). | ||
| 37 | - resource_request->load_flags = net::LOAD_DISABLE_CACHE; | ||
| 38 | - resource_request->credentials_mode = network::mojom::CredentialsMode::kOmit; | ||
| 39 | - simple_url_loader_ = network::SimpleURLLoader::Create( | ||
| 40 | - std::move(resource_request), traffic_annotation_); | ||
| 41 | - simple_url_loader_->DownloadToStringOfUnboundedSizeUntilCrashAndDie( | ||
| 42 | - url_loader_factory_.get(), | ||
| 43 | - base::BindOnce(&WebResourceService::OnSimpleLoaderComplete, | ||
| 44 | - base::Unretained(this))); | ||
| 45 | + in_fetch_ = false; | ||
| 46 | } | ||
| 47 | |||
| 48 | void WebResourceService::EndFetch() { | ||
diff --git a/www/chromium-uc/patches/core/inox-patchset/0009-disable-google-ipv6-probes.patch b/www/chromium-uc/patches/core/inox-patchset/0009-disable-google-ipv6-probes.patch new file mode 100644 index 0000000..9f78ade --- /dev/null +++ b/www/chromium-uc/patches/core/inox-patchset/0009-disable-google-ipv6-probes.patch | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | --- net/dns/host_resolver_manager.cc.orig | ||
| 2 | +++ net/dns/host_resolver_manager.cc | ||
| 3 | @@ -139,10 +139,10 @@ const unsigned kMinimumTTLSeconds = kCac | ||
| 4 | // cached. | ||
| 5 | const int kIPv6ProbePeriodMs = 1000; | ||
| 6 | |||
| 7 | -// Google DNS address used for IPv6 probes. | ||
| 8 | -const uint8_t kIPv6ProbeAddress[] = {0x20, 0x01, 0x48, 0x60, 0x48, 0x60, | ||
| 9 | +// RIPE NCC k.root-servers.net. 2001:7fd::1 (anycasted), used for IPv6 probes. | ||
| 10 | +const uint8_t kIPv6ProbeAddress[] = {0x20, 0x01, 0x07, 0xfd, 0x00, 0x00, | ||
| 11 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
| 12 | - 0x00, 0x00, 0x88, 0x88}; | ||
| 13 | + 0x00, 0x00, 0x00, 0x01}; | ||
| 14 | |||
| 15 | enum DnsResolveStatus { | ||
| 16 | RESOLVE_STATUS_DNS_SUCCESS = 0, | ||
diff --git a/www/chromium-uc/patches/core/inox-patchset/0015-disable-update-pings.patch b/www/chromium-uc/patches/core/inox-patchset/0015-disable-update-pings.patch new file mode 100644 index 0000000..cc7f344 --- /dev/null +++ b/www/chromium-uc/patches/core/inox-patchset/0015-disable-update-pings.patch | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | --- chrome/updater/configurator.cc.orig | ||
| 2 | +++ chrome/updater/configurator.cc | ||
| 3 | @@ -82,7 +82,7 @@ int Configurator::UpdateDelay() const { | ||
| 4 | } | ||
| 5 | |||
| 6 | std::vector<GURL> Configurator::UpdateUrl() const { | ||
| 7 | - return external_constants_->UpdateURL(); | ||
| 8 | + return std::vector<GURL>; | ||
| 9 | } | ||
| 10 | |||
| 11 | std::vector<GURL> Configurator::PingUrl() const { | ||
diff --git a/www/chromium-uc/patches/core/inox-patchset/0017-disable-new-avatar-menu.patch b/www/chromium-uc/patches/core/inox-patchset/0017-disable-new-avatar-menu.patch new file mode 100644 index 0000000..269fb0c --- /dev/null +++ b/www/chromium-uc/patches/core/inox-patchset/0017-disable-new-avatar-menu.patch | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | --- components/signin/internal/identity_manager/primary_account_policy_manager_impl.cc.orig | ||
| 2 | +++ components/signin/internal/identity_manager/primary_account_policy_manager_impl.cc | ||
| 3 | @@ -86,7 +86,7 @@ void PrimaryAccountPolicyManagerImpl::On | ||
| 4 | } | ||
| 5 | |||
| 6 | bool PrimaryAccountPolicyManagerImpl::IsSigninAllowed() const { | ||
| 7 | - return signin_allowed_.GetValue(); | ||
| 8 | + return false; | ||
| 9 | } | ||
| 10 | |||
| 11 | void PrimaryAccountPolicyManagerImpl::OnSigninAllowedPrefChanged( | ||
diff --git a/www/chromium-uc/patches/core/inox-patchset/0021-disable-rlz.patch b/www/chromium-uc/patches/core/inox-patchset/0021-disable-rlz.patch new file mode 100644 index 0000000..4b96b3e --- /dev/null +++ b/www/chromium-uc/patches/core/inox-patchset/0021-disable-rlz.patch | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | # Disable rlz | ||
| 2 | |||
| 3 | --- BUILD.gn.orig | ||
| 4 | +++ BUILD.gn | ||
| 5 | @@ -485,14 +485,6 @@ group("gn_all") { | ||
| 6 | deps += [ "//chromeos:chromeos_unittests" ] | ||
| 7 | } | ||
| 8 | |||
| 9 | - if (is_chromeos_ash || is_mac || is_win) { | ||
| 10 | - deps += [ | ||
| 11 | - "//rlz:rlz_id", | ||
| 12 | - "//rlz:rlz_lib", | ||
| 13 | - "//rlz:rlz_unittests", | ||
| 14 | - ] | ||
| 15 | - } | ||
| 16 | - | ||
| 17 | if (is_linux || is_chromeos) { | ||
| 18 | # The following are definitely linux-only. | ||
| 19 | deps += [ | ||
| 20 | --- rlz/buildflags/buildflags.gni.orig | ||
| 21 | +++ rlz/buildflags/buildflags.gni | ||
| 22 | @@ -7,6 +7,6 @@ import("//build/config/chromeos/ui_mode. | ||
| 23 | |||
| 24 | # Whether we are using the rlz library or not. Platforms like Android send | ||
| 25 | # rlz codes for searches but do not use the library. | ||
| 26 | -enable_rlz_support = is_win || is_apple || is_chromeos_ash | ||
| 27 | +enable_rlz_support = false | ||
| 28 | |||
| 29 | enable_rlz = is_chrome_branded && enable_rlz_support | ||
diff --git a/www/chromium-uc/patches/core/iridium-browser/all-add-trk-prefixes-to-possibly-evil-connections.patch b/www/chromium-uc/patches/core/iridium-browser/all-add-trk-prefixes-to-possibly-evil-connections.patch new file mode 100644 index 0000000..198b00e --- /dev/null +++ b/www/chromium-uc/patches/core/iridium-browser/all-add-trk-prefixes-to-possibly-evil-connections.patch | |||
| @@ -0,0 +1,858 @@ | |||
| 1 | From 06f6141610cb2aa562c94dbb9f1f4355e4b34c5d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jan Engelhardt <jengelh@inai.de> | ||
| 3 | Date: Mon, 30 Sep 2019 09:37:51 +0200 | ||
| 4 | Subject: [PATCH 75/76] all: add trk: prefixes to possibly evil connections | ||
| 5 | |||
| 6 | Prefix URLs to Google services with trk: so that whenever something | ||
| 7 | tries to load them, the developer will be informed via printf and | ||
| 8 | dialog (extra info bar between URLbar and content window) about this. | ||
| 9 | |||
| 10 | If you see such dialog, we know that (a) either the URL needs to be | ||
| 11 | whitelisted, or (b) the feature that triggered it needs to be disabled | ||
| 12 | by default. | ||
| 13 | --- | ||
| 14 | build/mac/tweak_info_plist.py | 2 +- | ||
| 15 | .../customization/customization_document.cc | 2 +- | ||
| 16 | .../file_manager/private_api_drive.cc | 2 +- | ||
| 17 | .../file_manager/private_api_misc.cc | 2 +- | ||
| 18 | .../remote_commands/crd_host_delegate.cc | 6 +++--- | ||
| 19 | .../cryptotoken_private_api.cc | 4 ++-- | ||
| 20 | chrome/browser/extensions/install_signer.cc | 2 +- | ||
| 21 | .../media/webrtc/webrtc_event_log_uploader.cc | 2 +- | ||
| 22 | .../media/webrtc/webrtc_log_uploader.cc | 2 +- | ||
| 23 | .../nacl_host/nacl_infobar_delegate.cc | 2 +- | ||
| 24 | .../profiles/profile_avatar_downloader.cc | 2 +- | ||
| 25 | .../default_apps/external_extensions.json | 6 +++--- | ||
| 26 | .../client_side_detection_service.cc | 2 +- | ||
| 27 | .../download_protection/download_feedback.cc | 2 +- | ||
| 28 | .../spellcheck_hunspell_dictionary.cc | 2 +- | ||
| 29 | .../supervised_user_service.cc | 2 +- | ||
| 30 | .../browser/tracing/crash_service_uploader.cc | 2 +- | ||
| 31 | .../ui/views/outdated_upgrade_bubble_view.cc | 2 +- | ||
| 32 | .../ui/webui/ntp/ntp_resource_cache.cc | 8 ++++---- | ||
| 33 | .../components/recovery_component.cc | 2 +- | ||
| 34 | .../crash/crashpad_crash_reporter.cc | 2 +- | ||
| 35 | .../extensions/chrome_extensions_client.cc | 4 ++-- | ||
| 36 | .../setup/google_chrome_behaviors.cc | 2 +- | ||
| 37 | .../browser/service/cast_service_simple.cc | 2 +- | ||
| 38 | chromecast/crash/linux/minidump_uploader.cc | 2 +- | ||
| 39 | .../simple_geolocation_provider.cc | 2 +- | ||
| 40 | .../common/cloud_devices_urls.cc | 8 ++++---- | ||
| 41 | components/drive/service/drive_api_service.cc | 4 ++-- | ||
| 42 | components/feedback/feedback_uploader.cc | 2 +- | ||
| 43 | components/gcm_driver/gcm_account_tracker.cc | 4 ++-- | ||
| 44 | components/google/core/common/google_util.cc | 2 +- | ||
| 45 | .../core/browser/web_history_service.cc | 6 +++--- | ||
| 46 | components/metrics/url_constants.cc | 2 +- | ||
| 47 | .../core/browser/password_store.cc | 8 ++++---- | ||
| 48 | .../safe_search_url_checker_client.cc | 2 +- | ||
| 49 | .../safe_search_api/stub_url_checker.cc | 2 +- | ||
| 50 | .../core/browser/translate_url_fetcher.cc | 1 + | ||
| 51 | .../translate/core/common/translate_util.cc | 2 +- | ||
| 52 | .../variations/variations_url_constants.cc | 2 +- | ||
| 53 | .../speech/speech_recognition_engine.cc | 2 +- | ||
| 54 | .../browser/webauth/authenticator_common.cc | 4 ++-- | ||
| 55 | .../shell/browser/shell_browser_main_parts.cc | 2 +- | ||
| 56 | google_apis/gaia/gaia_constants.cc | 20 +++++++++---------- | ||
| 57 | google_apis/gaia/gaia_urls.cc | 1 + | ||
| 58 | google_apis/gcm/engine/gservices_settings.cc | 6 +++--- | ||
| 59 | .../notifier/base/gaia_token_pre_xmpp_auth.cc | 2 +- | ||
| 60 | remoting/base/breakpad_mac.mm | 2 +- | ||
| 61 | remoting/protocol/jingle_messages.cc | 2 +- | ||
| 62 | rlz/lib/lib_values.cc | 2 +- | ||
| 63 | third_party/libjingle_xmpp/xmpp/constants.cc | 6 +++--- | ||
| 64 | .../chromevox/background/prefs.js | 4 ++-- | ||
| 65 | .../chromevoxclassic/host/chrome/host.js | 4 ++-- | ||
| 66 | ui/views/examples/webview_example.cc | 2 +- | ||
| 67 | 54 files changed, 89 insertions(+), 87 deletions(-) | ||
| 68 | |||
| 69 | --- build/apple/tweak_info_plist.py.orig | ||
| 70 | +++ build/apple/tweak_info_plist.py | ||
| 71 | @@ -195,7 +195,7 @@ def _AddKeystoneKeys(plist, bundle_ident | ||
| 72 | also requires the |bundle_identifier| argument (com.example.product).""" | ||
| 73 | plist['KSVersion'] = plist['CFBundleShortVersionString'] | ||
| 74 | plist['KSProductID'] = bundle_identifier | ||
| 75 | - plist['KSUpdateURL'] = 'https://tools.google.com/service/update2' | ||
| 76 | + plist['KSUpdateURL'] = 'trk:132:https://tools.google.com/service/update2' | ||
| 77 | |||
| 78 | _RemoveKeys(plist, 'KSChannelID') | ||
| 79 | if base_tag != '': | ||
| 80 | --- chrome/browser/ash/customization/customization_document.cc.orig | ||
| 81 | +++ chrome/browser/ash/customization/customization_document.cc | ||
| 82 | @@ -175,7 +175,7 @@ std::string ReadFileInBackground(const b | ||
| 83 | |||
| 84 | // Template URL where to fetch OEM services customization manifest from. | ||
| 85 | const char ServicesCustomizationDocument::kManifestUrl[] = | ||
| 86 | - "https://ssl.gstatic.com/chrome/chromeos-customization/%s.json"; | ||
| 87 | + "trk:151:https://ssl.gstatic.com/chrome/chromeos-customization/%s.json"; | ||
| 88 | |||
| 89 | // A custom extensions::ExternalLoader that the ServicesCustomizationDocument | ||
| 90 | // creates and uses to publish OEM default apps to the extensions system. | ||
| 91 | --- chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc.orig | ||
| 92 | +++ chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc | ||
| 93 | @@ -87,7 +87,7 @@ namespace { | ||
| 94 | |||
| 95 | using api::file_manager_private::ProfileInfo; | ||
| 96 | |||
| 97 | -const char kCWSScope[] = "https://www.googleapis.com/auth/chromewebstore"; | ||
| 98 | +const char kCWSScope[] = "trk:209:https://www.googleapis.com/auth/chromewebstore"; | ||
| 99 | |||
| 100 | // Thresholds for mountCrostini() API. | ||
| 101 | constexpr base::TimeDelta kMountCrostiniSlowOperationThreshold = | ||
| 102 | --- chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.cc.orig | ||
| 103 | +++ chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.cc | ||
| 104 | @@ -52,8 +52,8 @@ namespace { | ||
| 105 | |||
| 106 | const char kGoogleDotCom[] = "google.com"; | ||
| 107 | constexpr const char* kGoogleGstaticAppIds[] = { | ||
| 108 | - "https://www.gstatic.com/securitykey/origins.json", | ||
| 109 | - "https://www.gstatic.com/securitykey/a/google.com/origins.json"}; | ||
| 110 | + "trk:273:https://www.gstatic.com/securitykey/origins.json", | ||
| 111 | + "trk:274:https://www.gstatic.com/securitykey/a/google.com/origins.json"}; | ||
| 112 | |||
| 113 | // ContainsAppIdByHash returns true iff the SHA-256 hash of one of the | ||
| 114 | // elements of |list| equals |hash|. | ||
| 115 | --- chrome/browser/extensions/install_signer.cc.orig | ||
| 116 | +++ chrome/browser/extensions/install_signer.cc | ||
| 117 | @@ -67,7 +67,7 @@ const int kSignatureFormatVersion = 2; | ||
| 118 | const size_t kSaltBytes = 32; | ||
| 119 | |||
| 120 | const char kBackendUrl[] = | ||
| 121 | - "https://www.googleapis.com/chromewebstore/v1.1/items/verify"; | ||
| 122 | + "trk:222:https://www.googleapis.com/chromewebstore/v1.1/items/verify"; | ||
| 123 | |||
| 124 | const char kPublicKeyPEM[] = \ | ||
| 125 | "-----BEGIN PUBLIC KEY-----" \ | ||
| 126 | --- chrome/browser/media/webrtc/webrtc_event_log_uploader.cc.orig | ||
| 127 | +++ chrome/browser/media/webrtc/webrtc_event_log_uploader.cc | ||
| 128 | @@ -125,7 +125,7 @@ void OnURLLoadUploadProgress(uint64_t cu | ||
| 129 | } // namespace | ||
| 130 | |||
| 131 | const char WebRtcEventLogUploaderImpl::kUploadURL[] = | ||
| 132 | - "https://clients2.google.com/cr/report"; | ||
| 133 | + "trk:300:https://clients2.google.com/cr/report"; | ||
| 134 | |||
| 135 | WebRtcEventLogUploaderImpl::Factory::Factory( | ||
| 136 | scoped_refptr<base::SequencedTaskRunner> task_runner) | ||
| 137 | --- chrome/browser/media/webrtc/webrtc_log_uploader.cc.orig | ||
| 138 | +++ chrome/browser/media/webrtc/webrtc_log_uploader.cc | ||
| 139 | @@ -485,7 +485,7 @@ void WebRtcLogUploader::UploadCompressed | ||
| 140 | "Not implemented, it would be good to do so." | ||
| 141 | })"); | ||
| 142 | |||
| 143 | - constexpr char kUploadURL[] = "https://clients2.google.com/cr/report"; | ||
| 144 | + constexpr char kUploadURL[] = "trk:301:https://clients2.google.com/cr/report"; | ||
| 145 | auto resource_request = std::make_unique<network::ResourceRequest>(); | ||
| 146 | resource_request->url = !upload_url_for_testing_.is_empty() | ||
| 147 | ? upload_url_for_testing_ | ||
| 148 | --- chrome/browser/nacl_host/nacl_infobar_delegate.cc.orig | ||
| 149 | +++ chrome/browser/nacl_host/nacl_infobar_delegate.cc | ||
| 150 | @@ -33,7 +33,7 @@ std::u16string NaClInfoBarDelegate::GetL | ||
| 151 | } | ||
| 152 | |||
| 153 | GURL NaClInfoBarDelegate::GetLinkURL() const { | ||
| 154 | - return GURL("https://support.google.com/chrome/?p=ib_nacl"); | ||
| 155 | + return GURL("trk:143:https://support.google.com/chrome/?p=ib_nacl"); | ||
| 156 | } | ||
| 157 | |||
| 158 | std::u16string NaClInfoBarDelegate::GetMessageText() const { | ||
| 159 | --- chrome/browser/profiles/profile_avatar_downloader.cc.orig | ||
| 160 | +++ chrome/browser/profiles/profile_avatar_downloader.cc | ||
| 161 | @@ -20,7 +20,7 @@ | ||
| 162 | |||
| 163 | namespace { | ||
| 164 | const char kHighResAvatarDownloadUrlPrefix[] = | ||
| 165 | - "https://www.gstatic.com/chrome/profile_avatars/"; | ||
| 166 | + "trk:271:https://www.gstatic.com/chrome/profile_avatars/"; | ||
| 167 | } | ||
| 168 | |||
| 169 | ProfileAvatarDownloader::ProfileAvatarDownloader(size_t icon_index, | ||
| 170 | --- chrome/browser/resources/default_apps/external_extensions.json.orig | ||
| 171 | +++ chrome/browser/resources/default_apps/external_extensions.json | ||
| 172 | @@ -23,17 +23,17 @@ | ||
| 173 | }, | ||
| 174 | // Google Sheets | ||
| 175 | "aapocclcgogkmnckokdopfmhonfmgoek" : { | ||
| 176 | - "external_update_url": "https://clients2.google.com/service/update2/crx", | ||
| 177 | + "external_update_url": "trk:03:https://clients2.google.com/service/update2/crx", | ||
| 178 | "web_app_migration_flag": "MigrateDefaultChromeAppToWebAppsGSuite" | ||
| 179 | }, | ||
| 180 | // Google Slides | ||
| 181 | "felcaaldnbdncclmgdcncolpebgiejap" : { | ||
| 182 | - "external_update_url": "https://clients2.google.com/service/update2/crx", | ||
| 183 | + "external_update_url": "trk:04:https://clients2.google.com/service/update2/crx", | ||
| 184 | "web_app_migration_flag": "MigrateDefaultChromeAppToWebAppsGSuite" | ||
| 185 | }, | ||
| 186 | // Drive extension | ||
| 187 | "ghbmnnjooekpmoecnnnilnnbdlolhkhi" : { | ||
| 188 | - "external_update_url": "https://clients2.google.com/service/update2/crx" | ||
| 189 | + "external_update_url": "trk:04:https://clients2.google.com/service/update2/crx" | ||
| 190 | } | ||
| 191 | } | ||
| 192 | |||
| 193 | --- chrome/browser/safe_browsing/download_protection/download_feedback.cc.orig | ||
| 194 | +++ chrome/browser/safe_browsing/download_protection/download_feedback.cc | ||
| 195 | @@ -202,7 +202,7 @@ const int64_t DownloadFeedback::kMaxUplo | ||
| 196 | |||
| 197 | // static | ||
| 198 | const char DownloadFeedback::kSbFeedbackURL[] = | ||
| 199 | - "https://safebrowsing.google.com/safebrowsing/uploads/chrome"; | ||
| 200 | + "trk:164:https://safebrowsing.google.com/safebrowsing/uploads/chrome"; | ||
| 201 | |||
| 202 | // static | ||
| 203 | DownloadFeedbackFactory* DownloadFeedback::factory_ = nullptr; | ||
| 204 | --- chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc.orig | ||
| 205 | +++ chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc | ||
| 206 | @@ -279,7 +279,7 @@ GURL SpellcheckHunspellDictionary::GetDi | ||
| 207 | DCHECK(!bdict_file.empty()); | ||
| 208 | |||
| 209 | static const char kDownloadServerUrl[] = | ||
| 210 | - "https://redirector.gvt1.com/edgedl/chrome/dict/"; | ||
| 211 | + "trk:173:https://redirector.gvt1.com/edgedl/chrome/dict/"; | ||
| 212 | |||
| 213 | return GURL(std::string(kDownloadServerUrl) + | ||
| 214 | base::ToLowerASCII(bdict_file)); | ||
| 215 | --- chrome/browser/supervised_user/supervised_user_service.cc.orig | ||
| 216 | +++ chrome/browser/supervised_user/supervised_user_service.cc | ||
| 217 | @@ -87,7 +87,7 @@ namespace { | ||
| 218 | |||
| 219 | // The URL from which to download a host denylist if no local one exists yet. | ||
| 220 | const char kDenylistURL[] = | ||
| 221 | - "https://www.gstatic.com/chrome/supervised_user/denylist-20141001-1k.bin"; | ||
| 222 | + "trk:272:https://www.gstatic.com/chrome/supervised_user/denylist-20141001-1k.bin"; | ||
| 223 | // The filename under which we'll store the denylist (in the user data dir). The | ||
| 224 | // old file will be used as a backup in case the new file has not been loaded | ||
| 225 | // yet. | ||
| 226 | --- chrome/browser/ui/views/outdated_upgrade_bubble_view.cc.orig | ||
| 227 | +++ chrome/browser/ui/views/outdated_upgrade_bubble_view.cc | ||
| 228 | @@ -54,7 +54,7 @@ const char* kUpdateBrowserRedirectUrl = | ||
| 229 | #else | ||
| 230 | // The URL to be used to re-install Chrome when auto-update failed for | ||
| 231 | // too long. | ||
| 232 | - "https://www.google.com/chrome"; | ||
| 233 | + "trk:242:https://www.google.com/chrome"; | ||
| 234 | #endif | ||
| 235 | |||
| 236 | bool g_upgrade_bubble_is_showing = false; | ||
| 237 | --- chrome/browser/ui/webui/ntp/ntp_resource_cache.cc.orig | ||
| 238 | +++ chrome/browser/ui/webui/ntp/ntp_resource_cache.cc | ||
| 239 | @@ -67,17 +67,17 @@ namespace { | ||
| 240 | // The URL for the the Learn More page shown on incognito new tab. | ||
| 241 | const char kLearnMoreIncognitoUrl[] = | ||
| 242 | #if BUILDFLAG(IS_CHROMEOS_ASH) | ||
| 243 | - "https://support.google.com/chromebook/?p=incognito"; | ||
| 244 | + "trk:246:https://support.google.com/chromebook/?p=incognito"; | ||
| 245 | #else | ||
| 246 | - "https://support.google.com/chrome/?p=incognito"; | ||
| 247 | + "trk:247:https://support.google.com/chrome/?p=incognito"; | ||
| 248 | #endif | ||
| 249 | |||
| 250 | // The URL for the Learn More page shown on guest session new tab. | ||
| 251 | const char kLearnMoreGuestSessionUrl[] = | ||
| 252 | #if BUILDFLAG(IS_CHROMEOS_ASH) | ||
| 253 | - "https://support.google.com/chromebook/?p=chromebook_guest"; | ||
| 254 | + "trk:248:https://support.google.com/chromebook/?p=chromebook_guest"; | ||
| 255 | #else | ||
| 256 | - "https://support.google.com/chrome/?p=ui_guest"; | ||
| 257 | + "trk:261:https://support.google.com/chrome/?p=ui_guest"; | ||
| 258 | #endif | ||
| 259 | |||
| 260 | std::string ReplaceTemplateExpressions( | ||
| 261 | --- chrome/chrome_cleaner/components/recovery_component.cc.orig | ||
| 262 | +++ chrome/chrome_cleaner/components/recovery_component.cc | ||
| 263 | @@ -37,7 +37,7 @@ namespace chrome_cleaner { | ||
| 264 | namespace { | ||
| 265 | |||
| 266 | const char kComponentDownloadUrl[] = | ||
| 267 | - "https://clients2.google.com/service/update2/crx?response=redirect&os=win" | ||
| 268 | + "trk:108:https://clients2.google.com/service/update2/crx?response=redirect&os=win" | ||
| 269 | "&installsource=swreporter&x=id%3Dnpdjjkjlcidkjlamlmmdelcjbcpdjocm" | ||
| 270 | "%26v%3D0.0.0.0%26uc&acceptformat=crx3"; | ||
| 271 | |||
| 272 | --- chrome/chrome_cleaner/crash/crashpad_crash_reporter.cc.orig | ||
| 273 | +++ chrome/chrome_cleaner/crash/crashpad_crash_reporter.cc | ||
| 274 | @@ -28,7 +28,7 @@ | ||
| 275 | namespace { | ||
| 276 | |||
| 277 | // The URL where crash reports are uploaded. | ||
| 278 | -const char kReportUploadURL[] = "https://clients2.google.com/cr/report"; | ||
| 279 | +const char kReportUploadURL[] = "trk:302:https://clients2.google.com/cr/report"; | ||
| 280 | |||
| 281 | // Whether the current process is connected to a crash handler process. | ||
| 282 | bool g_is_connected_to_crash_handler = false; | ||
| 283 | --- chrome/common/extensions/chrome_extensions_client.cc.orig | ||
| 284 | +++ chrome/common/extensions/chrome_extensions_client.cc | ||
| 285 | @@ -45,9 +45,9 @@ namespace { | ||
| 286 | |||
| 287 | // TODO(battre): Delete the HTTP URL once the blocklist is downloaded via HTTPS. | ||
| 288 | const char kExtensionBlocklistUrlPrefix[] = | ||
| 289 | - "http://www.gstatic.com/chrome/extensions/blocklist"; | ||
| 290 | + "trk:269:http://www.gstatic.com/chrome/extensions/blocklist"; | ||
| 291 | const char kExtensionBlocklistHttpsUrlPrefix[] = | ||
| 292 | - "https://www.gstatic.com/chrome/extensions/blocklist"; | ||
| 293 | + "trk:270:https://www.gstatic.com/chrome/extensions/blocklist"; | ||
| 294 | |||
| 295 | const char kThumbsWhiteListedExtension[] = "khopmbdjffemhegeeobelklnbglcdgfh"; | ||
| 296 | |||
| 297 | --- chrome/installer/setup/google_chrome_behaviors.cc.orig | ||
| 298 | +++ chrome/installer/setup/google_chrome_behaviors.cc | ||
| 299 | @@ -37,7 +37,7 @@ namespace installer { | ||
| 300 | namespace { | ||
| 301 | |||
| 302 | constexpr base::WStringPiece kUninstallSurveyUrl( | ||
| 303 | - L"https://support.google.com/chrome?p=chrome_uninstall_survey"); | ||
| 304 | + L"trk:253:https://support.google.com/chrome?p=chrome_uninstall_survey"); | ||
| 305 | |||
| 306 | bool NavigateToUrlWithEdge(const std::wstring& url) { | ||
| 307 | std::wstring protocol_url = L"microsoft-edge:" + url; | ||
| 308 | --- chromecast/browser/service/cast_service_simple.cc.orig | ||
| 309 | +++ chromecast/browser/service/cast_service_simple.cc | ||
| 310 | @@ -27,7 +27,7 @@ GURL GetStartupURL() { | ||
| 311 | const base::CommandLine::StringVector& args = command_line->GetArgs(); | ||
| 312 | |||
| 313 | if (args.empty()) | ||
| 314 | - return GURL("http://www.google.com/"); | ||
| 315 | + return GURL("trk:255:http://www.google.com/"); | ||
| 316 | |||
| 317 | GURL url(args[0]); | ||
| 318 | if (url.is_valid() && url.has_scheme()) | ||
| 319 | --- chromecast/crash/linux/minidump_uploader.cc.orig | ||
| 320 | +++ chromecast/crash/linux/minidump_uploader.cc | ||
| 321 | @@ -41,7 +41,7 @@ namespace { | ||
| 322 | |||
| 323 | const char kProductName[] = "Eureka"; | ||
| 324 | |||
| 325 | -const char kCrashServerProduction[] = "https://clients2.google.com/cr/report"; | ||
| 326 | +const char kCrashServerProduction[] = "trk:305:https://clients2.google.com/cr/report"; | ||
| 327 | |||
| 328 | const char kVirtualChannel[] = "virtual-channel"; | ||
| 329 | |||
| 330 | --- chromeos/geolocation/simple_geolocation_provider.cc.orig | ||
| 331 | +++ chromeos/geolocation/simple_geolocation_provider.cc | ||
| 332 | @@ -20,7 +20,7 @@ namespace chromeos { | ||
| 333 | namespace { | ||
| 334 | |||
| 335 | const char kDefaultGeolocationProviderUrl[] = | ||
| 336 | - "https://www.googleapis.com/geolocation/v1/geolocate?"; | ||
| 337 | + "trk:215:https://www.googleapis.com/geolocation/v1/geolocate?"; | ||
| 338 | |||
| 339 | } // namespace | ||
| 340 | |||
| 341 | --- components/cloud_devices/common/cloud_devices_urls.cc.orig | ||
| 342 | +++ components/cloud_devices/common/cloud_devices_urls.cc | ||
| 343 | @@ -13,14 +13,14 @@ | ||
| 344 | namespace cloud_devices { | ||
| 345 | |||
| 346 | const char kCloudPrintAuthScope[] = | ||
| 347 | - "https://www.googleapis.com/auth/cloudprint"; | ||
| 348 | + "trk:197:https://www.googleapis.com/auth/cloudprint"; | ||
| 349 | |||
| 350 | namespace { | ||
| 351 | |||
| 352 | // Url must not be matched by "urls" section of | ||
| 353 | // cloud_print_app/manifest.json. If it's matched, print driver dialog will | ||
| 354 | // open sign-in page in separate window. | ||
| 355 | -const char kCloudPrintURL[] = "https://www.google.com/cloudprint"; | ||
| 356 | +const char kCloudPrintURL[] = "trk:201:https://www.google.com/cloudprint"; | ||
| 357 | |||
| 358 | } | ||
| 359 | |||
| 360 | --- components/drive/service/drive_api_service.cc.orig | ||
| 361 | +++ components/drive/service/drive_api_service.cc | ||
| 362 | @@ -75,9 +75,9 @@ namespace drive { | ||
| 363 | namespace { | ||
| 364 | |||
| 365 | // OAuth2 scopes for Drive API. | ||
| 366 | -const char kDriveScope[] = "https://www.googleapis.com/auth/drive"; | ||
| 367 | +const char kDriveScope[] = "trk:217:https://www.googleapis.com/auth/drive"; | ||
| 368 | const char kDriveAppsReadonlyScope[] = | ||
| 369 | - "https://www.googleapis.com/auth/drive.apps.readonly"; | ||
| 370 | + "trk:218:https://www.googleapis.com/auth/drive.apps.readonly"; | ||
| 371 | const char kDriveAppsScope[] = "https://www.googleapis.com/auth/drive.apps"; | ||
| 372 | |||
| 373 | // Mime type to create a directory. | ||
| 374 | --- components/feedback/feedback_uploader.cc.orig | ||
| 375 | +++ components/feedback/feedback_uploader.cc | ||
| 376 | @@ -27,7 +27,7 @@ constexpr base::FilePath::CharType kFeed | ||
| 377 | FILE_PATH_LITERAL("Feedback Reports"); | ||
| 378 | |||
| 379 | constexpr char kFeedbackPostUrl[] = | ||
| 380 | - "https://www.google.com/tools/feedback/chrome/__submit"; | ||
| 381 | + "trk:232:https://www.google.com/tools/feedback/chrome/__submit"; | ||
| 382 | |||
| 383 | constexpr char kProtoBufMimeType[] = "application/x-protobuf"; | ||
| 384 | |||
| 385 | --- components/google/core/common/google_util.cc.orig | ||
| 386 | +++ components/google/core/common/google_util.cc | ||
| 387 | @@ -143,7 +143,7 @@ bool IsGoogleSearchSubdomainUrl(const GU | ||
| 388 | |||
| 389 | // Global functions ----------------------------------------------------------- | ||
| 390 | |||
| 391 | -const char kGoogleHomepageURL[] = "https://www.google.com/"; | ||
| 392 | +const char kGoogleHomepageURL[] = "trk:113:https://www.google.com/"; | ||
| 393 | |||
| 394 | bool HasGoogleSearchQueryParam(base::StringPiece str) { | ||
| 395 | url::Component query(0, static_cast<int>(str.length())), key, value; | ||
| 396 | --- components/history/core/browser/web_history_service.cc.orig | ||
| 397 | +++ components/history/core/browser/web_history_service.cc | ||
| 398 | @@ -42,13 +42,13 @@ namespace history { | ||
| 399 | namespace { | ||
| 400 | |||
| 401 | const char kHistoryOAuthScope[] = | ||
| 402 | - "https://www.googleapis.com/auth/chromesync"; | ||
| 403 | + "trk:138:https://www.googleapis.com/auth/chromesync"; | ||
| 404 | |||
| 405 | const char kHistoryQueryHistoryUrl[] = | ||
| 406 | - "https://history.google.com/history/api/lookup?client=chrome"; | ||
| 407 | + "trk:139:https://history.google.com/history/api/lookup?client=chrome"; | ||
| 408 | |||
| 409 | const char kHistoryDeleteHistoryUrl[] = | ||
| 410 | - "https://history.google.com/history/api/delete?client=chrome"; | ||
| 411 | + "trk:140:https://history.google.com/history/api/delete?client=chrome"; | ||
| 412 | |||
| 413 | const char kHistoryAudioHistoryUrl[] = | ||
| 414 | "https://history.google.com/history/api/lookup?client=audio"; | ||
| 415 | --- components/metrics/url_constants.cc.orig | ||
| 416 | +++ components/metrics/url_constants.cc | ||
| 417 | @@ -7,7 +7,7 @@ | ||
| 418 | namespace metrics { | ||
| 419 | |||
| 420 | const char kNewMetricsServerUrl[] = | ||
| 421 | - "https://clientservices.googleapis.com/uma/v2"; | ||
| 422 | + "trk:265:https://clientservices.googleapis.com/uma/v2"; | ||
| 423 | |||
| 424 | const char kNewMetricsServerUrlInsecure[] = | ||
| 425 | "http://clientservices.googleapis.com/uma/v2"; | ||
| 426 | --- components/safe_browsing/content/browser/client_side_detection_service.cc.orig | ||
| 427 | +++ components/safe_browsing/content/browser/client_side_detection_service.cc | ||
| 428 | @@ -62,7 +62,7 @@ const int ClientSideDetectionService::kN | ||
| 429 | const int ClientSideDetectionService::kPositiveCacheIntervalMinutes = 30; | ||
| 430 | |||
| 431 | const char ClientSideDetectionService::kClientReportPhishingUrl[] = | ||
| 432 | - "https://sb-ssl.google.com/safebrowsing/clientreport/phishing"; | ||
| 433 | + "trk:148:https://sb-ssl.google.com/safebrowsing/clientreport/phishing"; | ||
| 434 | |||
| 435 | struct ClientSideDetectionService::ClientPhishingReportInfo { | ||
| 436 | std::unique_ptr<network::SimpleURLLoader> loader; | ||
| 437 | --- components/safe_search_api/safe_search/safe_search_url_checker_client.cc.orig | ||
| 438 | +++ components/safe_search_api/safe_search/safe_search_url_checker_client.cc | ||
| 439 | @@ -28,7 +28,7 @@ namespace safe_search_api { | ||
| 440 | namespace { | ||
| 441 | |||
| 442 | const char kSafeSearchApiUrl[] = | ||
| 443 | - "https://safesearch.googleapis.com/v1:classify"; | ||
| 444 | + "trk:238:https://safesearch.googleapis.com/v1:classify"; | ||
| 445 | const char kDataContentType[] = "application/x-www-form-urlencoded"; | ||
| 446 | const char kDataFormat[] = "key=%s&urls=%s"; | ||
| 447 | |||
| 448 | --- components/safe_search_api/stub_url_checker.cc.orig | ||
| 449 | +++ components/safe_search_api/stub_url_checker.cc | ||
| 450 | @@ -21,7 +21,7 @@ namespace safe_search_api { | ||
| 451 | namespace { | ||
| 452 | |||
| 453 | constexpr char kSafeSearchApiUrl[] = | ||
| 454 | - "https://safesearch.googleapis.com/v1:classify"; | ||
| 455 | + "trk:238:https://safesearch.googleapis.com/v1:classify"; | ||
| 456 | |||
| 457 | std::string BuildResponse(bool is_porn) { | ||
| 458 | base::DictionaryValue dict; | ||
| 459 | --- components/translate/core/browser/translate_url_fetcher.cc.orig | ||
| 460 | +++ components/translate/core/browser/translate_url_fetcher.cc | ||
| 461 | @@ -99,6 +99,7 @@ bool TranslateURLFetcher::Request(const | ||
| 462 | if (!extra_request_header_.empty()) | ||
| 463 | resource_request->headers.AddHeaderFromString(extra_request_header_); | ||
| 464 | |||
| 465 | + fprintf(stderr, "translator: fetching something from %s\n", url_.spec().c_str()); | ||
| 466 | simple_loader_ = | ||
| 467 | variations::CreateSimpleURLLoaderWithVariationsHeaderUnknownSignedIn( | ||
| 468 | std::move(resource_request), | ||
| 469 | --- components/translate/core/common/translate_util.cc.orig | ||
| 470 | +++ components/translate/core/common/translate_util.cc | ||
| 471 | @@ -20,7 +20,7 @@ const char kDetectLanguageInSubFrames[] | ||
| 472 | |||
| 473 | } // namespace | ||
| 474 | |||
| 475 | -const char kSecurityOrigin[] = "https://translate.googleapis.com/"; | ||
| 476 | +const char kSecurityOrigin[] = "trk:220:https://translate.googleapis.com/"; | ||
| 477 | |||
| 478 | const base::Feature kTranslateSubFrames{"TranslateSubFrames", | ||
| 479 | base::FEATURE_DISABLED_BY_DEFAULT}; | ||
| 480 | --- components/variations/variations_url_constants.cc.orig | ||
| 481 | +++ components/variations/variations_url_constants.cc | ||
| 482 | @@ -8,7 +8,7 @@ namespace variations { | ||
| 483 | |||
| 484 | // Default server of Variations seed info. | ||
| 485 | const char kDefaultServerUrl[] = | ||
| 486 | - "https://clientservices.googleapis.com/chrome-variations/seed"; | ||
| 487 | + "trk:142:https://clientservices.googleapis.com/chrome-variations/seed"; | ||
| 488 | |||
| 489 | const char kDefaultInsecureServerUrl[] = | ||
| 490 | "http://clientservices.googleapis.com/chrome-variations/seed"; | ||
| 491 | --- content/browser/speech/speech_recognition_engine.cc.orig | ||
| 492 | +++ content/browser/speech/speech_recognition_engine.cc | ||
| 493 | @@ -33,7 +33,7 @@ namespace content { | ||
| 494 | namespace { | ||
| 495 | |||
| 496 | const char kWebServiceBaseUrl[] = | ||
| 497 | - "https://www.google.com/speech-api/full-duplex/v1"; | ||
| 498 | + "trk:184:https://www.google.com/speech-api/full-duplex/v1"; | ||
| 499 | const char kDownstreamUrl[] = "/down?"; | ||
| 500 | const char kUpstreamUrl[] = "/up?"; | ||
| 501 | |||
| 502 | --- content/browser/webauth/authenticator_common.cc.orig | ||
| 503 | +++ content/browser/webauth/authenticator_common.cc | ||
| 504 | @@ -88,9 +88,9 @@ enum class RequestExtension { | ||
| 505 | namespace { | ||
| 506 | |||
| 507 | constexpr char kGstaticAppId[] = | ||
| 508 | - "https://www.gstatic.com/securitykey/origins.json"; | ||
| 509 | + "trk:276:https://www.gstatic.com/securitykey/origins.json"; | ||
| 510 | constexpr char kGstaticCorpAppId[] = | ||
| 511 | - "https://www.gstatic.com/securitykey/a/google.com/origins.json"; | ||
| 512 | + "trk:277:https://www.gstatic.com/securitykey/a/google.com/origins.json"; | ||
| 513 | |||
| 514 | WebAuthenticationDelegate* GetWebAuthenticationDelegate() { | ||
| 515 | return GetContentClient()->browser()->GetWebAuthenticationDelegate(); | ||
| 516 | --- content/shell/browser/shell_browser_main_parts.cc.orig | ||
| 517 | +++ content/shell/browser/shell_browser_main_parts.cc | ||
| 518 | @@ -96,7 +96,7 @@ GURL GetStartupURL() { | ||
| 519 | #else | ||
| 520 | const base::CommandLine::StringVector& args = command_line->GetArgs(); | ||
| 521 | if (args.empty()) | ||
| 522 | - return GURL("https://www.google.com/"); | ||
| 523 | + return GURL("trk:183:https://www.google.com/"); | ||
| 524 | |||
| 525 | #if defined(OS_WIN) | ||
| 526 | GURL url(base::WideToUTF16(args[0])); | ||
| 527 | --- extensions/common/extension_urls.cc.orig | ||
| 528 | +++ extensions/common/extension_urls.cc | ||
| 529 | @@ -26,9 +26,9 @@ bool IsSourceFromAnExtension(const std:: | ||
| 530 | |||
| 531 | namespace extension_urls { | ||
| 532 | |||
| 533 | -const char kChromeWebstoreBaseURL[] = "https://chrome.google.com/webstore"; | ||
| 534 | +const char kChromeWebstoreBaseURL[] = "trk:09:https://chrome.google.com/webstore"; | ||
| 535 | const char kChromeWebstoreUpdateURL[] = | ||
| 536 | - "https://clients2.google.com/service/update2/crx"; | ||
| 537 | + "trk:05:https://clients2.google.com/service/update2/crx"; | ||
| 538 | |||
| 539 | GURL GetWebstoreLaunchURL() { | ||
| 540 | extensions::ExtensionsClient* client = extensions::ExtensionsClient::Get(); | ||
| 541 | --- google_apis/gaia/gaia_constants.cc.orig | ||
| 542 | +++ google_apis/gaia/gaia_constants.cc | ||
| 543 | @@ -25,133 +25,133 @@ const char kSyncService[] = "chromiumsyn | ||
| 544 | const char kRemotingService[] = "chromoting"; | ||
| 545 | |||
| 546 | // OAuth scopes. | ||
| 547 | -const char kOAuth1LoginScope[] = "https://www.google.com/accounts/OAuthLogin"; | ||
| 548 | +const char kOAuth1LoginScope[] = "trk:069:https://www.google.com/accounts/OAuthLogin"; | ||
| 549 | |||
| 550 | // Service/scope names for device management (cloud-based policy) server. | ||
| 551 | const char kDeviceManagementServiceOAuth[] = | ||
| 552 | - "https://www.googleapis.com/auth/chromeosdevicemanagement"; | ||
| 553 | + "trk:070:https://www.googleapis.com/auth/chromeosdevicemanagement"; | ||
| 554 | |||
| 555 | // OAuth2 scope for access to all Google APIs. | ||
| 556 | -const char kAnyApiOAuth2Scope[] = "https://www.googleapis.com/auth/any-api"; | ||
| 557 | +const char kAnyApiOAuth2Scope[] = "trk:071:https://www.googleapis.com/auth/any-api"; | ||
| 558 | |||
| 559 | // OAuth2 scope for access to Chrome sync APIs | ||
| 560 | const char kChromeSyncOAuth2Scope[] = | ||
| 561 | - "https://www.googleapis.com/auth/chromesync"; | ||
| 562 | + "trk:072:https://www.googleapis.com/auth/chromesync"; | ||
| 563 | // OAuth2 scope for access to the Chrome Sync APIs for managed profiles. | ||
| 564 | const char kChromeSyncSupervisedOAuth2Scope[] = | ||
| 565 | - "https://www.googleapis.com/auth/chromesync_playpen"; | ||
| 566 | + "trk:073:https://www.googleapis.com/auth/chromesync_playpen"; | ||
| 567 | |||
| 568 | // OAuth2 scope for access to Kid Management API. | ||
| 569 | const char kKidManagementOAuth2Scope[] = | ||
| 570 | - "https://www.googleapis.com/auth/kid.management"; | ||
| 571 | + "trk:074:https://www.googleapis.com/auth/kid.management"; | ||
| 572 | |||
| 573 | // OAuth2 scope for parental consent logging for secondary account addition. | ||
| 574 | const char kKidManagementPrivilegedOAuth2Scope[] = | ||
| 575 | - "https://www.googleapis.com/auth/kid.management.privileged"; | ||
| 576 | + "trk:075:https://www.googleapis.com/auth/kid.management.privileged"; | ||
| 577 | |||
| 578 | // OAuth2 scope for access to Google Family Link Supervision Setup. | ||
| 579 | const char kKidsSupervisionSetupChildOAuth2Scope[] = | ||
| 580 | - "https://www.googleapis.com/auth/kids.supervision.setup.child"; | ||
| 581 | + "trk:076:https://www.googleapis.com/auth/kids.supervision.setup.child"; | ||
| 582 | |||
| 583 | // OAuth2 scope for access to Google Talk APIs (XMPP). | ||
| 584 | const char kGoogleTalkOAuth2Scope[] = | ||
| 585 | - "https://www.googleapis.com/auth/googletalk"; | ||
| 586 | + "trk:077:https://www.googleapis.com/auth/googletalk"; | ||
| 587 | |||
| 588 | // OAuth2 scope for access to Google account information. | ||
| 589 | const char kGoogleUserInfoEmail[] = | ||
| 590 | - "https://www.googleapis.com/auth/userinfo.email"; | ||
| 591 | + "trk:078:https://www.googleapis.com/auth/userinfo.email"; | ||
| 592 | const char kGoogleUserInfoProfile[] = | ||
| 593 | - "https://www.googleapis.com/auth/userinfo.profile"; | ||
| 594 | + "trk:079:https://www.googleapis.com/auth/userinfo.profile"; | ||
| 595 | |||
| 596 | // OAuth2 scope for access to the people API (read-only). | ||
| 597 | const char kPeopleApiReadOnlyOAuth2Scope[] = | ||
| 598 | - "https://www.googleapis.com/auth/peopleapi.readonly"; | ||
| 599 | + "trk:080:https://www.googleapis.com/auth/peopleapi.readonly"; | ||
| 600 | |||
| 601 | // OAuth2 scope for access to the Reauth flow. | ||
| 602 | const char kAccountsReauthOAuth2Scope[] = | ||
| 603 | - "https://www.googleapis.com/auth/accounts.reauth"; | ||
| 604 | + "trk:081:https://www.googleapis.com/auth/accounts.reauth"; | ||
| 605 | |||
| 606 | // OAuth2 scope for access to audit recording (ARI). | ||
| 607 | const char kAuditRecordingOAuth2Scope[] = | ||
| 608 | - "https://www.googleapis.com/auth/auditrecording-pa"; | ||
| 609 | + "trk:082:https://www.googleapis.com/auth/auditrecording-pa"; | ||
| 610 | |||
| 611 | // OAuth2 scope for access to clear cut logs. | ||
| 612 | -const char kClearCutOAuth2Scope[] = "https://www.googleapis.com/auth/cclog"; | ||
| 613 | +const char kClearCutOAuth2Scope[] = "trk:083:https://www.googleapis.com/auth/cclog"; | ||
| 614 | |||
| 615 | // OAuth2 scope for FCM, the Firebase Cloud Messaging service. | ||
| 616 | const char kFCMOAuthScope[] = | ||
| 617 | - "https://www.googleapis.com/auth/firebase.messaging"; | ||
| 618 | + "trk:084:https://www.googleapis.com/auth/firebase.messaging"; | ||
| 619 | |||
| 620 | // OAuth2 scope for access to Tachyon api. | ||
| 621 | -const char kTachyonOAuthScope[] = "https://www.googleapis.com/auth/tachyon"; | ||
| 622 | +const char kTachyonOAuthScope[] = "trk:085:https://www.googleapis.com/auth/tachyon"; | ||
| 623 | |||
| 624 | // OAuth2 scope for access to the Photos API. | ||
| 625 | -const char kPhotosOAuth2Scope[] = "https://www.googleapis.com/auth/photos"; | ||
| 626 | +const char kPhotosOAuth2Scope[] = "trk:086:https://www.googleapis.com/auth/photos"; | ||
| 627 | |||
| 628 | // OAuth2 scope for access to Cast backdrop API. | ||
| 629 | const char kCastBackdropOAuth2Scope[] = | ||
| 630 | - "https://www.googleapis.com/auth/cast.backdrop"; | ||
| 631 | + "trk:087:https://www.googleapis.com/auth/cast.backdrop"; | ||
| 632 | |||
| 633 | // OAuth scope for access to Cloud Translation API. | ||
| 634 | const char kCloudTranslationOAuth2Scope[] = | ||
| 635 | - "https://www.googleapis.com/auth/cloud-translation"; | ||
| 636 | + "trk:088:https://www.googleapis.com/auth/cloud-translation"; | ||
| 637 | |||
| 638 | // OAuth2 scope for access to passwords leak checking API. | ||
| 639 | const char kPasswordsLeakCheckOAuth2Scope[] = | ||
| 640 | - "https://www.googleapis.com/auth/identity.passwords.leak.check"; | ||
| 641 | + "trk:089:https://www.googleapis.com/auth/identity.passwords.leak.check"; | ||
| 642 | |||
| 643 | // OAuth2 scope for access to Chrome safe browsing API. | ||
| 644 | const char kChromeSafeBrowsingOAuth2Scope[] = | ||
| 645 | - "https://www.googleapis.com/auth/chrome-safe-browsing"; | ||
| 646 | + "trk:090:https://www.googleapis.com/auth/chrome-safe-browsing"; | ||
| 647 | |||
| 648 | // OAuth2 scope for access to kid permissions by URL. | ||
| 649 | const char kClassifyUrlKidPermissionOAuth2Scope[] = | ||
| 650 | - "https://www.googleapis.com/auth/kid.permission"; | ||
| 651 | + "trk:091:https://www.googleapis.com/auth/kid.permission"; | ||
| 652 | const char kKidFamilyReadonlyOAuth2Scope[] = | ||
| 653 | - "https://www.googleapis.com/auth/kid.family.readonly"; | ||
| 654 | + "trk:092:https://www.googleapis.com/auth/kid.family.readonly"; | ||
| 655 | |||
| 656 | // OAuth2 scope for access to payments. | ||
| 657 | const char kPaymentsOAuth2Scope[] = | ||
| 658 | - "https://www.googleapis.com/auth/wallet.chrome"; | ||
| 659 | + "trk:093:https://www.googleapis.com/auth/wallet.chrome"; | ||
| 660 | |||
| 661 | const char kCryptAuthOAuth2Scope[] = | ||
| 662 | - "https://www.googleapis.com/auth/cryptauth"; | ||
| 663 | + "trk:094:https://www.googleapis.com/auth/cryptauth"; | ||
| 664 | |||
| 665 | // OAuth2 scope for access to Drive. | ||
| 666 | -const char kDriveOAuth2Scope[] = "https://www.googleapis.com/auth/drive"; | ||
| 667 | +const char kDriveOAuth2Scope[] = "trk:095:https://www.googleapis.com/auth/drive"; | ||
| 668 | |||
| 669 | // The scope required for an access token in order to query ItemSuggest. | ||
| 670 | const char kDriveReadOnlyOAuth2Scope[] = | ||
| 671 | - "https://www.googleapis.com/auth/drive.readonly"; | ||
| 672 | + "trk:096:https://www.googleapis.com/auth/drive.readonly"; | ||
| 673 | |||
| 674 | // OAuth2 scope for access to Assistant SDK. | ||
| 675 | const char kAssistantOAuth2Scope[] = | ||
| 676 | - "https://www.googleapis.com/auth/assistant-sdk-prototype"; | ||
| 677 | + "trk:097:https://www.googleapis.com/auth/assistant-sdk-prototype"; | ||
| 678 | |||
| 679 | // OAuth2 scope for access to nearby devices (fast pair) APIs. | ||
| 680 | const char kCloudPlatformProjectsOAuth2Scope[] = | ||
| 681 | - "https://www.googleapis.com/auth/cloudplatformprojects"; | ||
| 682 | + "trk:098:https://www.googleapis.com/auth/cloudplatformprojects"; | ||
| 683 | |||
| 684 | // OAuth2 scope for access to nearby sharing. | ||
| 685 | const char kNearbyShareOAuth2Scope[] = | ||
| 686 | - "https://www.googleapis.com/auth/nearbysharing-pa"; | ||
| 687 | + "trk:099:https://www.googleapis.com/auth/nearbysharing-pa"; | ||
| 688 | |||
| 689 | // OAuth2 scopes for access to GCM account tracker. | ||
| 690 | -const char kGCMGroupServerOAuth2Scope[] = "https://www.googleapis.com/auth/gcm"; | ||
| 691 | +const char kGCMGroupServerOAuth2Scope[] = "trk:100:https://www.googleapis.com/auth/gcm"; | ||
| 692 | const char kGCMCheckinServerOAuth2Scope[] = | ||
| 693 | - "https://www.googleapis.com/auth/android_checkin"; | ||
| 694 | + "trk:101:https://www.googleapis.com/auth/android_checkin"; | ||
| 695 | |||
| 696 | // OAuth2 scope for access to readonly Chrome web store. | ||
| 697 | const char kChromeWebstoreOAuth2Scope[] = | ||
| 698 | - "https://www.googleapis.com/auth/chromewebstore.readonly"; | ||
| 699 | + "trk:102:https://www.googleapis.com/auth/chromewebstore.readonly"; | ||
| 700 | |||
| 701 | // OAuth2 scope for access to Account Capabilities API. | ||
| 702 | const char kAccountCapabilitiesOAuth2Scope[] = | ||
| 703 | - "https://www.googleapis.com/auth/account.capabilities"; | ||
| 704 | + "trk:103:https://www.googleapis.com/auth/account.capabilities"; | ||
| 705 | |||
| 706 | // OAuth2 scope for support content API. | ||
| 707 | const char kSupportContentOAuth2Scope[] = | ||
| 708 | - "https://www.googleapis.com/auth/supportcontent"; | ||
| 709 | + "trk:104:https://www.googleapis.com/auth/supportcontent"; | ||
| 710 | |||
| 711 | // OAuth 2 scope for NTP Photos module API. | ||
| 712 | const char kPhotosModuleOAuth2Scope[] = | ||
| 713 | --- google_apis/gaia/gaia_urls.cc.orig | ||
| 714 | +++ google_apis/gaia/gaia_urls.cc | ||
| 715 | @@ -24,6 +24,7 @@ | ||
| 716 | namespace { | ||
| 717 | |||
| 718 | // Gaia service constants | ||
| 719 | +//adding trk: here currently crashes the program | ||
| 720 | const char kDefaultGoogleUrl[] = "http://google.com"; | ||
| 721 | const char kDefaultGaiaUrl[] = "https://accounts.google.com"; | ||
| 722 | const char kDefaultGoogleApisBaseUrl[] = "https://www.googleapis.com"; | ||
| 723 | --- google_apis/gcm/engine/gservices_settings.cc.orig | ||
| 724 | +++ google_apis/gcm/engine/gservices_settings.cc | ||
| 725 | @@ -30,18 +30,18 @@ const char kRegistrationURLKey[] = "gcm_ | ||
| 726 | |||
| 727 | const int64_t kDefaultCheckinInterval = 2 * 24 * 60 * 60; // seconds = 2 days. | ||
| 728 | const int64_t kMinimumCheckinInterval = 12 * 60 * 60; // seconds = 12 hours. | ||
| 729 | -const char kDefaultCheckinURL[] = "https://android.clients.google.com/checkin"; | ||
| 730 | +const char kDefaultCheckinURL[] = "trk:110:https://android.clients.google.com/checkin"; | ||
| 731 | const char kDefaultMCSHostname[] = "mtalk.google.com"; | ||
| 732 | const int kDefaultMCSMainSecurePort = 5228; | ||
| 733 | const int kDefaultMCSFallbackSecurePort = 443; | ||
| 734 | const char kDefaultRegistrationURL[] = | ||
| 735 | - "https://android.clients.google.com/c2dm/register3"; | ||
| 736 | + "trk:111:https://android.clients.google.com/c2dm/register3"; | ||
| 737 | // Settings that are to be deleted are marked with this prefix in checkin | ||
| 738 | // response. | ||
| 739 | const char kDeleteSettingPrefix[] = "delete_"; | ||
| 740 | // Settings digest starts with verison number followed by '-'. | ||
| 741 | const char kDigestVersionPrefix[] = "1-"; | ||
| 742 | -const char kMCSEnpointTemplate[] = "https://%s:%d"; | ||
| 743 | +const char kMCSEnpointTemplate[] = "trk:112:https://%s:%d"; | ||
| 744 | const int kMaxSecurePort = 65535; | ||
| 745 | |||
| 746 | std::string MakeMCSEndpoint(const std::string& mcs_hostname, int port) { | ||
| 747 | --- jingle/notifier/base/gaia_token_pre_xmpp_auth.cc.orig | ||
| 748 | +++ jingle/notifier/base/gaia_token_pre_xmpp_auth.cc | ||
| 749 | @@ -36,7 +36,7 @@ class GaiaCookieMechanism : public jingl | ||
| 750 | // These attributes are necessary for working with non-gmail gaia | ||
| 751 | // accounts. | ||
| 752 | const std::string NS_GOOGLE_AUTH_PROTOCOL( | ||
| 753 | - "http://www.google.com/talk/protocol/auth"); | ||
| 754 | + "trk:179:http://www.google.com/talk/protocol/auth"); | ||
| 755 | const jingle_xmpp::QName QN_GOOGLE_ALLOW_GENERATED_JID_XMPP_LOGIN( | ||
| 756 | NS_GOOGLE_AUTH_PROTOCOL, "allow-generated-jid"); | ||
| 757 | const jingle_xmpp::QName QN_GOOGLE_AUTH_CLIENT_USES_FULL_BIND_RESULT( | ||
| 758 | --- remoting/base/breakpad_mac.mm.orig | ||
| 759 | +++ remoting/base/breakpad_mac.mm | ||
| 760 | @@ -50,7 +50,7 @@ void InitializeCrashReporting() { | ||
| 761 | breakpad_config[@BREAKPAD_REPORT_INTERVAL] = @"21600"; | ||
| 762 | } | ||
| 763 | if (!breakpad_config[@BREAKPAD_URL]) { | ||
| 764 | - breakpad_config[@BREAKPAD_URL] = @"https://clients2.google.com/cr/report"; | ||
| 765 | + breakpad_config[@BREAKPAD_URL] = @"trk:310:https://clients2.google.com/cr/report"; | ||
| 766 | } | ||
| 767 | |||
| 768 | if (!BreakpadCreate(breakpad_config)) { | ||
| 769 | --- remoting/protocol/jingle_messages.cc.orig | ||
| 770 | +++ remoting/protocol/jingle_messages.cc | ||
| 771 | @@ -27,7 +27,7 @@ const char kJabberNamespace[] = "jabber: | ||
| 772 | const char kJingleNamespace[] = "urn:xmpp:jingle:1"; | ||
| 773 | |||
| 774 | // Namespace for transport messages when using standard ICE. | ||
| 775 | -const char kIceTransportNamespace[] = "google:remoting:ice"; | ||
| 776 | +const char kIceTransportNamespace[] = "trk:100:google:remoting:ice"; | ||
| 777 | |||
| 778 | const char kWebrtcTransportNamespace[] = "google:remoting:webrtc"; | ||
| 779 | |||
| 780 | --- rlz/lib/lib_values.cc.orig | ||
| 781 | +++ rlz/lib/lib_values.cc | ||
| 782 | @@ -40,7 +40,7 @@ const char kSetDccResponseVariable[] = " | ||
| 783 | // | ||
| 784 | |||
| 785 | const char kFinancialPingPath[] = "/tools/pso/ping"; | ||
| 786 | -const char kFinancialServer[] = "clients1.google.com"; | ||
| 787 | +const char kFinancialServer[] = "trk:443:clients1.google.com"; /* not using URLRequest! catch with cache.ir */ | ||
| 788 | const int kFinancialPort = 443; | ||
| 789 | |||
| 790 | // Ping times in 100-nanosecond intervals. | ||
| 791 | --- third_party/libjingle_xmpp/xmpp/constants.cc.orig | ||
| 792 | +++ third_party/libjingle_xmpp/xmpp/constants.cc | ||
| 793 | @@ -194,7 +194,7 @@ const StaticQName QN_SASL_TEMPORARY_AUTH | ||
| 794 | |||
| 795 | // These are non-standard. | ||
| 796 | const char NS_GOOGLE_AUTH_PROTOCOL[] = | ||
| 797 | - "http://www.google.com/talk/protocol/auth"; | ||
| 798 | + "trk:236:http://www.google.com/talk/protocol/auth"; | ||
| 799 | const StaticQName QN_GOOGLE_AUTH_CLIENT_USES_FULL_BIND_RESULT = | ||
| 800 | { NS_GOOGLE_AUTH_PROTOCOL, "client-uses-full-bind-result" }; | ||
| 801 | const StaticQName QN_GOOGLE_ALLOW_NON_GOOGLE_ID_XMPP_LOGIN = | ||
| 802 | @@ -338,7 +338,7 @@ const char STR_SHOW_DND[] = "dnd"; | ||
| 803 | const char STR_SHOW_XA[] = "xa"; | ||
| 804 | const char STR_SHOW_OFFLINE[] = "offline"; | ||
| 805 | |||
| 806 | -const char NS_GOOGLE_PSTN_CONFERENCE[] = "http://www.google.com/pstn-conference"; | ||
| 807 | +const char NS_GOOGLE_PSTN_CONFERENCE[] = "trk:237:http://www.google.com/pstn-conference"; | ||
| 808 | const StaticQName QN_GOOGLE_PSTN_CONFERENCE_STATUS = { NS_GOOGLE_PSTN_CONFERENCE, "status" }; | ||
| 809 | const StaticQName QN_ATTR_STATUS = { STR_EMPTY, "status" }; | ||
| 810 | |||
| 811 | @@ -433,7 +433,7 @@ const StaticQName QN_MUC_ROLE = { NS_MUC | ||
| 812 | const char STR_AFFILIATION_NONE[] = "none"; | ||
| 813 | const char STR_ROLE_PARTICIPANT[] = "participant"; | ||
| 814 | |||
| 815 | -const char NS_GOOGLE_SESSION[] = "http://www.google.com/session"; | ||
| 816 | +const char NS_GOOGLE_SESSION[] = "trk:238:http://www.google.com/session"; | ||
| 817 | const StaticQName QN_GOOGLE_CIRCLE_ID = { STR_EMPTY, "google-circle-id" }; | ||
| 818 | const StaticQName QN_GOOGLE_USER_ID = { STR_EMPTY, "google-user-id" }; | ||
| 819 | const StaticQName QN_GOOGLE_SESSION_BLOCKED = { NS_GOOGLE_SESSION, "blocked" }; | ||
| 820 | --- ui/accessibility/extensions/chromevoxclassic/chromevox/background/prefs.js.orig | ||
| 821 | +++ ui/accessibility/extensions/chromevoxclassic/chromevox/background/prefs.js | ||
| 822 | @@ -72,9 +72,9 @@ cvox.ChromeVoxPrefs.DEFAULT_PREFS = { | ||
| 823 | 'outputContextFirst': false, | ||
| 824 | 'position': '{}', | ||
| 825 | 'siteSpecificScriptBase': | ||
| 826 | - 'https://ssl.gstatic.com/accessibility/javascript/ext/', | ||
| 827 | + 'trk:242:https://ssl.gstatic.com/accessibility/javascript/ext/', | ||
| 828 | 'siteSpecificScriptLoader': | ||
| 829 | - 'https://ssl.gstatic.com/accessibility/javascript/ext/loader.js', | ||
| 830 | + 'trk:243:https://ssl.gstatic.com/accessibility/javascript/ext/loader.js', | ||
| 831 | 'sticky': false, | ||
| 832 | 'typingEcho': 0, | ||
| 833 | 'useIBeamCursor': cvox.ChromeVox.isMac, | ||
| 834 | --- ui/accessibility/extensions/chromevoxclassic/host/chrome/host.js.orig | ||
| 835 | +++ ui/accessibility/extensions/chromevoxclassic/host/chrome/host.js | ||
| 836 | @@ -96,9 +96,9 @@ cvox.ChromeHost.prototype.init = functio | ||
| 837 | (!cvox.ApiImplementation.siteSpecificScriptLoader || | ||
| 838 | !cvox.ApiImplementation.siteSpecificScriptBase); | ||
| 839 | cvox.ApiImplementation.siteSpecificScriptLoader = | ||
| 840 | - 'https://ssl.gstatic.com/accessibility/javascript/ext/loader.js'; | ||
| 841 | + 'trk:244:https://ssl.gstatic.com/accessibility/javascript/ext/loader.js'; | ||
| 842 | cvox.ApiImplementation.siteSpecificScriptBase = | ||
| 843 | - 'https://ssl.gstatic.com/accessibility/javascript/ext/'; | ||
| 844 | + 'trk:245:https://ssl.gstatic.com/accessibility/javascript/ext/'; | ||
| 845 | if (apiPrefsChanged) { | ||
| 846 | var searchInit = prefs['siteSpecificEnhancements'] === 'true' ? | ||
| 847 | cvox.SearchLoader.init : | ||
| 848 | --- ui/views/examples/webview_example.cc.orig | ||
| 849 | +++ ui/views/examples/webview_example.cc | ||
| 850 | @@ -29,7 +29,7 @@ void WebViewExample::CreateExampleView(V | ||
| 851 | webview_->GetWebContents()->SetDelegate(this); | ||
| 852 | container->SetLayoutManager(std::make_unique<FillLayout>()); | ||
| 853 | |||
| 854 | - webview_->LoadInitialURL(GURL("http://www.google.com/")); | ||
| 855 | + webview_->LoadInitialURL(GURL("trk:174:http://www.google.com/")); | ||
| 856 | webview_->GetWebContents()->Focus(); | ||
| 857 | } | ||
| 858 | |||
diff --git a/www/chromium-uc/patches/core/iridium-browser/safe_browsing-disable-incident-reporting.patch b/www/chromium-uc/patches/core/iridium-browser/safe_browsing-disable-incident-reporting.patch new file mode 100644 index 0000000..021abee --- /dev/null +++ b/www/chromium-uc/patches/core/iridium-browser/safe_browsing-disable-incident-reporting.patch | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | From 4dfa8ed0814040317cb82d8545502186daa0a204 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jan Engelhardt <jengelh@inai.de> | ||
| 3 | Date: Tue, 7 Jul 2015 17:02:09 +0200 | ||
| 4 | Subject: [PATCH 62/76] safe_browsing: disable incident reporting | ||
| 5 | |||
| 6 | Disables the safebrowsing incident reporting where you could upload | ||
| 7 | information about a blocked URL to Google (also added a trk prefix to | ||
| 8 | the URL so we get notified if this happens again in the future). | ||
| 9 | --- | ||
| 10 | .../incident_reporting/incident_report_uploader_impl.cc | 2 +- | ||
| 11 | .../incident_reporting/incident_reporting_service.cc | 3 +++ | ||
| 12 | chrome/browser/safe_browsing/safe_browsing_blocking_page.cc | 3 +-- | ||
| 13 | chrome/browser/safe_browsing/safe_browsing_service.cc | 2 +- | ||
| 14 | .../security_interstitials/core/safe_browsing_loud_error_ui.cc | 1 + | ||
| 15 | 5 files changed, 7 insertions(+), 4 deletions(-) | ||
| 16 | |||
| 17 | --- chrome/browser/safe_browsing/chrome_safe_browsing_blocking_page_factory.cc.orig | ||
| 18 | +++ chrome/browser/safe_browsing/chrome_safe_browsing_blocking_page_factory.cc | ||
| 19 | @@ -35,8 +35,7 @@ ChromeSafeBrowsingBlockingPageFactory::C | ||
| 20 | Profile::FromBrowserContext(web_contents->GetBrowserContext()); | ||
| 21 | // Create appropriate display options for this blocking page. | ||
| 22 | PrefService* prefs = profile->GetPrefs(); | ||
| 23 | - bool is_extended_reporting_opt_in_allowed = | ||
| 24 | - IsExtendedReportingOptInAllowed(*prefs); | ||
| 25 | + bool is_extended_reporting_opt_in_allowed = false; | ||
| 26 | bool is_proceed_anyway_disabled = | ||
| 27 | prefs->GetBoolean(prefs::kSafeBrowsingProceedAnywayDisabled); | ||
| 28 | |||
| 29 | --- chrome/browser/safe_browsing/incident_reporting/incident_report_uploader_impl.cc.orig | ||
| 30 | +++ chrome/browser/safe_browsing/incident_reporting/incident_report_uploader_impl.cc | ||
| 31 | @@ -27,7 +27,7 @@ namespace safe_browsing { | ||
| 32 | namespace { | ||
| 33 | |||
| 34 | const char kSbIncidentReportUrl[] = | ||
| 35 | - "https://sb-ssl.google.com/safebrowsing/clientreport/incident"; | ||
| 36 | + "trk:268:https://sb-ssl.google.com/safebrowsing/clientreport/incident"; | ||
| 37 | |||
| 38 | constexpr net::NetworkTrafficAnnotationTag | ||
| 39 | kSafeBrowsingIncidentTrafficAnnotation = | ||
| 40 | --- chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc.orig | ||
| 41 | +++ chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc | ||
| 42 | @@ -308,11 +308,14 @@ IncidentReportingService::UploadContext: | ||
| 43 | |||
| 44 | // static | ||
| 45 | bool IncidentReportingService::IsEnabledForProfile(Profile* profile) { | ||
| 46 | + return false; | ||
| 47 | +#if 0 | ||
| 48 | if (profile->IsOffTheRecord()) | ||
| 49 | return false; | ||
| 50 | if (!IsSafeBrowsingEnabled(*profile->GetPrefs())) | ||
| 51 | return false; | ||
| 52 | return IsExtendedReportingEnabled(*profile->GetPrefs()); | ||
| 53 | +#endif | ||
| 54 | } | ||
| 55 | |||
| 56 | IncidentReportingService::IncidentReportingService( | ||
| 57 | --- chrome/browser/safe_browsing/safe_browsing_service.cc.orig | ||
| 58 | +++ chrome/browser/safe_browsing/safe_browsing_service.cc | ||
| 59 | @@ -286,7 +286,7 @@ SafeBrowsingUIManager* SafeBrowsingServi | ||
| 60 | } | ||
| 61 | |||
| 62 | void SafeBrowsingService::RegisterAllDelayedAnalysis() { | ||
| 63 | -#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 64 | +#if 0 | ||
| 65 | RegisterBinaryIntegrityAnalysis(); | ||
| 66 | #endif | ||
| 67 | } | ||
| 68 | --- components/security_interstitials/core/safe_browsing_loud_error_ui.cc.orig | ||
| 69 | +++ components/security_interstitials/core/safe_browsing_loud_error_ui.cc | ||
| 70 | @@ -25,11 +25,11 @@ namespace { | ||
| 71 | // For malware interstitial pages, we link the problematic URL to Google's | ||
| 72 | // diagnostic page. | ||
| 73 | const char kSbDiagnosticUrl[] = | ||
| 74 | - "https://transparencyreport.google.com/safe-browsing/search?url=%s"; | ||
| 75 | + "trk:227:https://transparencyreport.google.com/safe-browsing/search?url=%s"; | ||
| 76 | |||
| 77 | // Constants for the V4 phishing string upgrades. | ||
| 78 | const char kReportPhishingErrorUrl[] = | ||
| 79 | - "https://safebrowsing.google.com/safebrowsing/report_error/?url=%s"; | ||
| 80 | + "trk:228:https://safebrowsing.google.com/safebrowsing/report_error/?url=%s"; | ||
| 81 | |||
| 82 | void RecordExtendedReportingPrefChanged(bool report) { | ||
| 83 | UMA_HISTOGRAM_BOOLEAN("SafeBrowsing.Pref.Extended.SecurityInterstitial", | ||
diff --git a/www/chromium-uc/patches/core/iridium-browser/safe_browsing-disable-reporting-of-safebrowsing-over.patch b/www/chromium-uc/patches/core/iridium-browser/safe_browsing-disable-reporting-of-safebrowsing-over.patch new file mode 100644 index 0000000..23f0675 --- /dev/null +++ b/www/chromium-uc/patches/core/iridium-browser/safe_browsing-disable-reporting-of-safebrowsing-over.patch | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | From c89ce946e5328ca8a7df923d421e904bb6bfe9b6 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jan Engelhardt <jengelh@inai.de> | ||
| 3 | Date: Tue, 7 Jul 2015 18:28:46 +0200 | ||
| 4 | Subject: [PATCH 63/76] safe_browsing: disable reporting of safebrowsing | ||
| 5 | override | ||
| 6 | |||
| 7 | Disables reporting of the safebrowsing override, i.e. the report sent | ||
| 8 | if a user decides to visit a page that was flagged as "insecure". | ||
| 9 | This prevents trk:148 (phishing) and trk:149 (malware). | ||
| 10 | --- | ||
| 11 | components/safe_browsing/content/browser/client_side_detection_service.cc | 5 +++++ | ||
| 12 | 1 file changed, 5 insertions(+) | ||
| 13 | |||
| 14 | --- components/safe_browsing/content/browser/client_side_detection_service.cc.orig | ||
| 15 | +++ components/safe_browsing/content/browser/client_side_detection_service.cc | ||
| 16 | @@ -209,6 +209,10 @@ void ClientSideDetectionService::StartCl | ||
| 17 | return; | ||
| 18 | } | ||
| 19 | |||
| 20 | +#if 1 | ||
| 21 | + if (!callback.is_null()) | ||
| 22 | + callback.Run(GURL(request->url()), false); | ||
| 23 | +#else | ||
| 24 | // Fill in metadata about which model we used. | ||
| 25 | *request->mutable_population() = delegate_->GetUserPopulation(); | ||
| 26 | |||
| 27 | @@ -288,6 +292,7 @@ void ClientSideDetectionService::StartCl | ||
| 28 | base::BindOnce(&WebUIInfoSingleton::AddToClientPhishingRequestsSent, | ||
| 29 | base::Unretained(WebUIInfoSingleton::GetInstance()), | ||
| 30 | std::move(request), access_token)); | ||
| 31 | +#endif | ||
| 32 | } | ||
| 33 | |||
| 34 | void ClientSideDetectionService::HandlePhishingVerdict( | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/block-requests.patch b/www/chromium-uc/patches/core/ungoogled-chromium/block-requests.patch new file mode 100644 index 0000000..1e29eb6 --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/block-requests.patch | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | ## Prevent request attempts | ||
| 2 | # chrome://discards/ attempts to use d3 to display the graph | ||
| 3 | --- chrome/browser/new_tab_page/one_google_bar/one_google_bar_loader_impl.cc.orig | ||
| 4 | +++ chrome/browser/new_tab_page/one_google_bar/one_google_bar_loader_impl.cc | ||
| 5 | @@ -286,6 +286,7 @@ OneGoogleBarLoaderImpl::OneGoogleBarLoad | ||
| 6 | OneGoogleBarLoaderImpl::~OneGoogleBarLoaderImpl() = default; | ||
| 7 | |||
| 8 | void OneGoogleBarLoaderImpl::Load(OneGoogleCallback callback) { | ||
| 9 | + return; | ||
| 10 | callbacks_.push_back(std::move(callback)); | ||
| 11 | |||
| 12 | // Note: If there is an ongoing request, abandon it. It's possible that | ||
| 13 | --- chrome/browser/new_tab_page/promos/promo_service.cc.orig | ||
| 14 | +++ chrome/browser/new_tab_page/promos/promo_service.cc | ||
| 15 | @@ -138,6 +138,7 @@ PromoService::PromoService( | ||
| 16 | PromoService::~PromoService() = default; | ||
| 17 | |||
| 18 | void PromoService::Refresh() { | ||
| 19 | + return; | ||
| 20 | net::NetworkTrafficAnnotationTag traffic_annotation = | ||
| 21 | net::DefineNetworkTrafficAnnotation("promo_service", R"( | ||
| 22 | semantics { | ||
| 23 | --- chrome/browser/resources/discards/graph_doc_template.html.orig | ||
| 24 | +++ chrome/browser/resources/discards/graph_doc_template.html | ||
| 25 | @@ -78,10 +78,6 @@ URL. As result, this document needs to b | ||
| 26 | } | ||
| 27 | |||
| 28 | </style> | ||
| 29 | - <script src="https://ajax.googleapis.com/ajax/libs/d3js/5.7.0/d3.min.js" | ||
| 30 | - integrity="sha384-HL96dun1KbYEq6UT/ZlsspAODCyQ+Zp4z318ajUPBPSMzy5dvxl6ziwmnil8/Cpd" | ||
| 31 | - crossorigin="anonymous"> | ||
| 32 | - </script> | ||
| 33 | <script type="application/javascript"> | ||
| 34 | ${javascript_file} | ||
| 35 | </script> | ||
| 36 | --- chrome/browser/search/background/ntp_background_service.cc.orig | ||
| 37 | +++ chrome/browser/search/background/ntp_background_service.cc | ||
| 38 | @@ -83,6 +83,7 @@ void NtpBackgroundService::Shutdown() { | ||
| 39 | } | ||
| 40 | |||
| 41 | void NtpBackgroundService::FetchCollectionInfo() { | ||
| 42 | + return; | ||
| 43 | if (collections_loader_ != nullptr) | ||
| 44 | return; | ||
| 45 | collection_error_info_.ClearError(); | ||
| 46 | --- chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc.orig | ||
| 47 | +++ chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc | ||
| 48 | @@ -286,6 +286,7 @@ GURL SpellcheckHunspellDictionary::GetDi | ||
| 49 | } | ||
| 50 | |||
| 51 | void SpellcheckHunspellDictionary::DownloadDictionary(GURL url) { | ||
| 52 | + return; | ||
| 53 | DCHECK_CURRENTLY_ON(BrowserThread::UI); | ||
| 54 | DCHECK(browser_context_); | ||
| 55 | |||
| 56 | --- components/assist_ranker/ranker_url_fetcher.cc.orig | ||
| 57 | +++ components/assist_ranker/ranker_url_fetcher.cc | ||
| 58 | @@ -31,6 +31,7 @@ bool RankerURLFetcher::Request( | ||
| 59 | const GURL& url, | ||
| 60 | RankerURLFetcher::Callback callback, | ||
| 61 | network::mojom::URLLoaderFactory* url_loader_factory) { | ||
| 62 | + return false; | ||
| 63 | // This function is not supposed to be called if the previous operation is not | ||
| 64 | // finished. | ||
| 65 | if (state_ == REQUESTING) { | ||
| 66 | --- components/update_client/update_checker.cc.orig | ||
| 67 | +++ components/update_client/update_checker.cc | ||
| 68 | @@ -129,6 +129,7 @@ void UpdateCheckerImpl::CheckForUpdates( | ||
| 69 | const base::flat_map<std::string, std::string>& additional_attributes, | ||
| 70 | bool enabled_component_updates, | ||
| 71 | UpdateCheckCallback update_check_callback) { | ||
| 72 | + return; | ||
| 73 | DCHECK(thread_checker_.CalledOnValidThread()); | ||
| 74 | |||
| 75 | ids_checked_ = ids_checked; | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/block-trk-and-subdomains.patch b/www/chromium-uc/patches/core/ungoogled-chromium/block-trk-and-subdomains.patch new file mode 100644 index 0000000..8b68a77 --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/block-trk-and-subdomains.patch | |||
| @@ -0,0 +1,234 @@ | |||
| 1 | # Block all connection requests with 'qjz9zk' in the domain name or with a 'trk:' scheme. | ||
| 2 | # This patch is based on Iridium's 'net: add "trk:" scheme and help identify URLs being retrieved' | ||
| 3 | |||
| 4 | --- chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc.orig | ||
| 5 | +++ chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc | ||
| 6 | @@ -56,6 +56,7 @@ ChromeAutocompleteSchemeClassifier::GetI | ||
| 7 | if (base::IsStringASCII(scheme) && | ||
| 8 | (ProfileIOData::IsHandledProtocol(scheme) || | ||
| 9 | base::LowerCaseEqualsASCII(scheme, content::kViewSourceScheme) || | ||
| 10 | + base::LowerCaseEqualsASCII(scheme, url::kTraceScheme) || | ||
| 11 | base::LowerCaseEqualsASCII(scheme, url::kJavaScriptScheme) || | ||
| 12 | base::LowerCaseEqualsASCII(scheme, url::kDataScheme))) { | ||
| 13 | return metrics::OmniboxInputType::URL; | ||
| 14 | --- chrome/browser/history/history_utils.cc.orig | ||
| 15 | +++ chrome/browser/history/history_utils.cc | ||
| 16 | @@ -21,6 +21,7 @@ bool CanAddURLToHistory(const GURL& url) | ||
| 17 | url.SchemeIs(content::kChromeDevToolsScheme) || | ||
| 18 | url.SchemeIs(content::kChromeUIScheme) || | ||
| 19 | url.SchemeIs(content::kViewSourceScheme) || | ||
| 20 | + url.SchemeIs(url::kTraceScheme) || | ||
| 21 | url.SchemeIs(chrome::kChromeNativeScheme) || | ||
| 22 | url.SchemeIs(chrome::kChromeSearchScheme) || | ||
| 23 | url.SchemeIs(dom_distiller::kDomDistillerScheme)) | ||
| 24 | --- chrome/browser/ui/singleton_tabs.cc.orig | ||
| 25 | +++ chrome/browser/ui/singleton_tabs.cc | ||
| 26 | @@ -99,7 +99,8 @@ int GetIndexOfExistingTab(Browser* brows | ||
| 27 | |||
| 28 | // Skip view-source tabs. This is needed because RewriteURLIfNecessary | ||
| 29 | // removes the "view-source:" scheme which leads to incorrect matching. | ||
| 30 | - if (tab_url.SchemeIs(content::kViewSourceScheme)) | ||
| 31 | + if (tab_url.SchemeIs(content::kViewSourceScheme) || | ||
| 32 | + tab_url.SchemeIs(url::kTraceScheme)) | ||
| 33 | continue; | ||
| 34 | |||
| 35 | GURL rewritten_tab_url = tab_url; | ||
| 36 | --- components/omnibox/browser/autocomplete_input.cc.orig | ||
| 37 | +++ components/omnibox/browser/autocomplete_input.cc | ||
| 38 | @@ -533,7 +533,8 @@ void AutocompleteInput::ParseForEmphasiz | ||
| 39 | // For the view-source and blob schemes, we should emphasize the host of the | ||
| 40 | // URL qualified by the view-source or blob prefix. | ||
| 41 | if ((base::LowerCaseEqualsASCII(scheme_str, kViewSourceScheme) || | ||
| 42 | - base::LowerCaseEqualsASCII(scheme_str, url::kBlobScheme)) && | ||
| 43 | + base::LowerCaseEqualsASCII(scheme_str, url::kBlobScheme) || | ||
| 44 | + base::LowerCaseEqualsASCII(scheme_str, url::kTraceScheme)) && | ||
| 45 | (static_cast<int>(text.length()) > after_scheme_and_colon)) { | ||
| 46 | // Obtain the URL prefixed by view-source or blob and parse it. | ||
| 47 | std::u16string real_url(text.substr(after_scheme_and_colon)); | ||
| 48 | --- components/url_formatter/url_fixer.cc.orig | ||
| 49 | +++ components/url_formatter/url_fixer.cc | ||
| 50 | @@ -562,6 +562,10 @@ GURL FixupURL(const std::string& text, c | ||
| 51 | } | ||
| 52 | } | ||
| 53 | |||
| 54 | + if (scheme == url::kTraceScheme) { | ||
| 55 | + return GURL(); | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | // We handle the file scheme separately. | ||
| 59 | if (scheme == url::kFileScheme) | ||
| 60 | return GURL(parts.scheme.is_valid() ? text : FixupPath(text)); | ||
| 61 | --- content/browser/child_process_security_policy_impl.cc.orig | ||
| 62 | +++ content/browser/child_process_security_policy_impl.cc | ||
| 63 | @@ -861,6 +861,7 @@ ChildProcessSecurityPolicyImpl::ChildPro | ||
| 64 | #endif // BUILDFLAG(ENABLE_WEBSOCKETS) | ||
| 65 | RegisterWebSafeScheme(url::kFtpScheme); | ||
| 66 | RegisterWebSafeScheme(url::kDataScheme); | ||
| 67 | + RegisterWebSafeScheme(url::kTraceScheme); | ||
| 68 | RegisterWebSafeScheme("feed"); | ||
| 69 | |||
| 70 | // TODO(nick): https://crbug.com/651534 blob: and filesystem: schemes embed | ||
| 71 | --- net/BUILD.gn.orig | ||
| 72 | +++ net/BUILD.gn | ||
| 73 | @@ -1010,6 +1010,8 @@ component("net") { | ||
| 74 | "url_request/report_sender.h", | ||
| 75 | "url_request/static_http_user_agent_settings.cc", | ||
| 76 | "url_request/static_http_user_agent_settings.h", | ||
| 77 | + "url_request/trk_protocol_handler.cc", | ||
| 78 | + "url_request/trk_protocol_handler.h", | ||
| 79 | "url_request/url_fetcher.cc", | ||
| 80 | "url_request/url_fetcher.h", | ||
| 81 | "url_request/url_fetcher_core.cc", | ||
| 82 | --- /dev/null | ||
| 83 | +++ net/url_request/trk_protocol_handler.cc | ||
| 84 | @@ -0,0 +1,25 @@ | ||
| 85 | +// Copyright (c) 2018 The ungoogled-chromium Authors. All rights reserved. | ||
| 86 | +// Use of this source code is governed by a BSD-style license that can be | ||
| 87 | +// found in the LICENSE file. | ||
| 88 | + | ||
| 89 | +#include "net/url_request/trk_protocol_handler.h" | ||
| 90 | + | ||
| 91 | +#include "base/logging.h" | ||
| 92 | +#include "net/base/net_errors.h" | ||
| 93 | +#include "net/url_request/url_request_error_job.h" | ||
| 94 | + | ||
| 95 | +namespace net { | ||
| 96 | + | ||
| 97 | +TrkProtocolHandler::TrkProtocolHandler() = default; | ||
| 98 | + | ||
| 99 | +std::unique_ptr<URLRequestJob> TrkProtocolHandler::CreateJob( | ||
| 100 | + URLRequest* request) const { | ||
| 101 | + LOG(ERROR) << "Blocked URL in TrkProtocolHandler: " << request->original_url(); | ||
| 102 | + return std::make_unique<URLRequestErrorJob>(request, ERR_BLOCKED_BY_CLIENT); | ||
| 103 | +} | ||
| 104 | + | ||
| 105 | +bool TrkProtocolHandler::IsSafeRedirectTarget(const GURL& location) const { | ||
| 106 | + return true; | ||
| 107 | +} | ||
| 108 | + | ||
| 109 | +} // namespace net | ||
| 110 | --- /dev/null | ||
| 111 | +++ net/url_request/trk_protocol_handler.h | ||
| 112 | @@ -0,0 +1,32 @@ | ||
| 113 | +// Copyright (c) 2018 The ungoogled-chromium Authors. All rights reserved. | ||
| 114 | +// Use of this source code is governed by a BSD-style license that can be | ||
| 115 | +// found in the LICENSE file. | ||
| 116 | + | ||
| 117 | +#ifndef NET_URL_REQUEST_TRK_PROTOCOL_HANDLER_H_ | ||
| 118 | +#define NET_URL_REQUEST_TRK_PROTOCOL_HANDLER_H_ | ||
| 119 | + | ||
| 120 | +#include "base/compiler_specific.h" | ||
| 121 | +#include "base/macros.h" | ||
| 122 | +#include "net/base/net_export.h" | ||
| 123 | +#include "net/url_request/url_request_job_factory.h" | ||
| 124 | + | ||
| 125 | +namespace net { | ||
| 126 | + | ||
| 127 | +class URLRequestJob; | ||
| 128 | + | ||
| 129 | +// Implements a ProtocolHandler for Trk jobs. | ||
| 130 | +class NET_EXPORT TrkProtocolHandler | ||
| 131 | + : public URLRequestJobFactory::ProtocolHandler { | ||
| 132 | + public: | ||
| 133 | + TrkProtocolHandler(); | ||
| 134 | + std::unique_ptr<URLRequestJob> CreateJob( | ||
| 135 | + URLRequest* request) const override; | ||
| 136 | + bool IsSafeRedirectTarget(const GURL& location) const override; | ||
| 137 | + | ||
| 138 | + private: | ||
| 139 | + DISALLOW_COPY_AND_ASSIGN(TrkProtocolHandler); | ||
| 140 | +}; | ||
| 141 | + | ||
| 142 | +} // namespace net | ||
| 143 | + | ||
| 144 | +#endif // NET_URL_REQUEST_TRK_PROTOCOL_HANDLER_H_ | ||
| 145 | --- net/url_request/url_request.cc.orig | ||
| 146 | +++ net/url_request/url_request.cc | ||
| 147 | @@ -12,6 +12,7 @@ | ||
| 148 | #include "base/compiler_specific.h" | ||
| 149 | #include "base/metrics/histogram_macros.h" | ||
| 150 | #include "base/rand_util.h" | ||
| 151 | +#include "base/strings/string_util.h" | ||
| 152 | #include "base/strings/utf_string_conversions.h" | ||
| 153 | #include "base/synchronization/lock.h" | ||
| 154 | #include "base/threading/thread_task_runner_handle.h" | ||
| 155 | @@ -46,6 +47,7 @@ | ||
| 156 | #include "net/url_request/url_request_redirect_job.h" | ||
| 157 | #include "url/gurl.h" | ||
| 158 | #include "url/origin.h" | ||
| 159 | +#include "url/url_constants.h" | ||
| 160 | |||
| 161 | using base::Time; | ||
| 162 | using std::string; | ||
| 163 | @@ -595,6 +597,12 @@ URLRequest::URLRequest(const GURL& url, | ||
| 164 | // Sanity check out environment. | ||
| 165 | DCHECK(base::ThreadTaskRunnerHandle::IsSet()); | ||
| 166 | |||
| 167 | + if (!url.SchemeIs(url::kTraceScheme) && | ||
| 168 | + base::EndsWith(url.host(), "qjz9zk", base::CompareCase::INSENSITIVE_ASCII)) { | ||
| 169 | + LOG(ERROR) << "Block URL in URLRequest: " << url; | ||
| 170 | + url_chain_[0] = GURL(url::kTraceScheme + (":" + url.possibly_invalid_spec())); | ||
| 171 | + } | ||
| 172 | + | ||
| 173 | context->url_requests()->insert(this); | ||
| 174 | net_log_.BeginEvent(NetLogEventType::REQUEST_ALIVE, [&] { | ||
| 175 | return NetLogURLRequestConstructorParams(url, priority_, | ||
| 176 | --- net/url_request/url_request_context_builder.cc.orig | ||
| 177 | +++ net/url_request/url_request_context_builder.cc | ||
| 178 | @@ -46,6 +46,7 @@ | ||
| 179 | #include "net/quic/quic_stream_factory.h" | ||
| 180 | #include "net/ssl/ssl_config_service_defaults.h" | ||
| 181 | #include "net/url_request/static_http_user_agent_settings.h" | ||
| 182 | +#include "net/url_request/trk_protocol_handler.h" | ||
| 183 | #include "net/url_request/url_request_context.h" | ||
| 184 | #include "net/url_request/url_request_context_storage.h" | ||
| 185 | #include "net/url_request/url_request_job_factory.h" | ||
| 186 | @@ -546,6 +547,9 @@ std::unique_ptr<URLRequestContext> URLRe | ||
| 187 | } | ||
| 188 | protocol_handlers_.clear(); | ||
| 189 | |||
| 190 | + job_factory->SetProtocolHandler(url::kTraceScheme, | ||
| 191 | + std::make_unique<TrkProtocolHandler>()); | ||
| 192 | + | ||
| 193 | storage->set_job_factory(std::move(job_factory)); | ||
| 194 | |||
| 195 | return std::move(context); | ||
| 196 | --- url/url_constants.cc.orig | ||
| 197 | +++ url/url_constants.cc | ||
| 198 | @@ -28,6 +28,7 @@ const char kMailToScheme[] = "mailto"; | ||
| 199 | // See also: https://www.iana.org/assignments/uri-schemes/prov/quic-transport | ||
| 200 | const char kQuicTransportScheme[] = "quic-transport"; | ||
| 201 | const char kTelScheme[] = "tel"; | ||
| 202 | +const char kTraceScheme[] = "trk"; | ||
| 203 | const char kUrnScheme[] = "urn"; | ||
| 204 | const char kWsScheme[] = "ws"; | ||
| 205 | const char kWssScheme[] = "wss"; | ||
| 206 | --- url/url_constants.h.orig | ||
| 207 | +++ url/url_constants.h | ||
| 208 | @@ -32,6 +32,7 @@ COMPONENT_EXPORT(URL) extern const char | ||
| 209 | COMPONENT_EXPORT(URL) extern const char kMailToScheme[]; | ||
| 210 | COMPONENT_EXPORT(URL) extern const char kQuicTransportScheme[]; | ||
| 211 | COMPONENT_EXPORT(URL) extern const char kTelScheme[]; | ||
| 212 | +COMPONENT_EXPORT(URL) extern const char kTraceScheme[]; | ||
| 213 | COMPONENT_EXPORT(URL) extern const char kUrnScheme[]; | ||
| 214 | COMPONENT_EXPORT(URL) extern const char kWsScheme[]; | ||
| 215 | COMPONENT_EXPORT(URL) extern const char kWssScheme[]; | ||
| 216 | --- url/url_util.cc.orig | ||
| 217 | +++ url/url_util.cc | ||
| 218 | @@ -63,7 +63,7 @@ struct SchemeRegistry { | ||
| 219 | |||
| 220 | // Schemes that do not trigger mixed content warning. | ||
| 221 | std::vector<std::string> secure_schemes = { | ||
| 222 | - kHttpsScheme, kAboutScheme, kDataScheme, kQuicTransportScheme, kWssScheme, | ||
| 223 | + kHttpsScheme, kAboutScheme, kDataScheme, kTraceScheme, kQuicTransportScheme, kWssScheme, | ||
| 224 | }; | ||
| 225 | |||
| 226 | // Schemes that normal pages cannot link to or access (i.e., with the same | ||
| 227 | @@ -78,6 +78,7 @@ struct SchemeRegistry { | ||
| 228 | kAboutScheme, | ||
| 229 | kJavaScriptScheme, | ||
| 230 | kDataScheme, | ||
| 231 | + kTraceScheme, | ||
| 232 | }; | ||
| 233 | |||
| 234 | // Schemes that can be sent CORS requests. | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/disable-crash-reporter.patch b/www/chromium-uc/patches/core/ungoogled-chromium/disable-crash-reporter.patch new file mode 100644 index 0000000..a4b3c51 --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/disable-crash-reporter.patch | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | # Disable some background communication with clients2.google.com | ||
| 2 | |||
| 3 | --- components/crash/core/app/crashpad_linux.cc.orig | ||
| 4 | +++ components/crash/core/app/crashpad_linux.cc | ||
| 5 | @@ -59,8 +59,7 @@ void SetFirstChanceExceptionHandler(bool | ||
| 6 | } | ||
| 7 | |||
| 8 | bool IsCrashpadEnabled() { | ||
| 9 | - return base::CommandLine::ForCurrentProcess()->HasSwitch( | ||
| 10 | - ::switches::kEnableCrashpad); | ||
| 11 | + return false; | ||
| 12 | } | ||
| 13 | |||
| 14 | bool GetHandlerSocket(int* fd, pid_t* pid) { | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/disable-domain-reliability.patch b/www/chromium-uc/patches/core/ungoogled-chromium/disable-domain-reliability.patch new file mode 100644 index 0000000..adc446c --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/disable-domain-reliability.patch | |||
| @@ -0,0 +1,725 @@ | |||
| 1 | ## Disable domain reliability component | ||
| 2 | # Many of these changes are for thoroughness, | ||
| 3 | # the most significant changes are in service_factory.cc and uploader.cc | ||
| 4 | |||
| 5 | --- chrome/browser/domain_reliability/service_factory.cc.orig | ||
| 6 | +++ chrome/browser/domain_reliability/service_factory.cc | ||
| 7 | @@ -11,34 +11,12 @@ | ||
| 8 | |||
| 9 | namespace domain_reliability { | ||
| 10 | |||
| 11 | -namespace { | ||
| 12 | - | ||
| 13 | -// If Domain Reliability is enabled in the absence of a flag or field trial. | ||
| 14 | -const bool kDefaultEnabled = true; | ||
| 15 | - | ||
| 16 | -// The name and value of the field trial to turn Domain Reliability on. | ||
| 17 | -const char kFieldTrialName[] = "DomRel-Enable"; | ||
| 18 | -const char kFieldTrialValueEnable[] = "enable"; | ||
| 19 | - | ||
| 20 | -} // namespace | ||
| 21 | - | ||
| 22 | // Identifies Chrome as the source of Domain Reliability uploads it sends. | ||
| 23 | const char DomainReliabilityServiceFactory::kUploadReporterString[] = "chrome"; | ||
| 24 | |||
| 25 | // static | ||
| 26 | bool DomainReliabilityServiceFactory::ShouldCreateService() { | ||
| 27 | - base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | ||
| 28 | - if (command_line->HasSwitch(switches::kDisableDomainReliability)) | ||
| 29 | - return false; | ||
| 30 | - if (command_line->HasSwitch(switches::kEnableDomainReliability)) | ||
| 31 | - return true; | ||
| 32 | - if (!ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled()) | ||
| 33 | - return false; | ||
| 34 | - if (base::FieldTrialList::TrialExists(kFieldTrialName)) { | ||
| 35 | - std::string value = base::FieldTrialList::FindFullName(kFieldTrialName); | ||
| 36 | - return (value == kFieldTrialValueEnable); | ||
| 37 | - } | ||
| 38 | - return kDefaultEnabled; | ||
| 39 | + return false; | ||
| 40 | } | ||
| 41 | |||
| 42 | } // namespace domain_reliability | ||
| 43 | --- components/domain_reliability/BUILD.gn.orig | ||
| 44 | +++ components/domain_reliability/BUILD.gn | ||
| 45 | @@ -7,26 +7,6 @@ action("bake_in_configs") { | ||
| 46 | script = "bake_in_configs.py" | ||
| 47 | |||
| 48 | inputs = [ | ||
| 49 | - "baked_in_configs/c_android_clients_google_com.json", | ||
| 50 | - "baked_in_configs/c_bigcache_googleapis_com.json", | ||
| 51 | - "baked_in_configs/c_doc-0-0-sj_sj_googleusercontent_com.json", | ||
| 52 | - "baked_in_configs/c_docs_google_com.json", | ||
| 53 | - "baked_in_configs/c_drive_google_com.json", | ||
| 54 | - "baked_in_configs/c_googlesyndication_com.json", | ||
| 55 | - "baked_in_configs/c_pack_google_com.json", | ||
| 56 | - "baked_in_configs/c_play_google_com.json", | ||
| 57 | - "baked_in_configs/c_youtube_com.json", | ||
| 58 | - "baked_in_configs/clients2_google_com.json", | ||
| 59 | - "baked_in_configs/docs_google_com.json", | ||
| 60 | - "baked_in_configs/gcp_gvt2_com.json", | ||
| 61 | - "baked_in_configs/gcp_gvt6_com.json", | ||
| 62 | - "baked_in_configs/google-analytics_com.json", | ||
| 63 | - "baked_in_configs/googlevideo_com.json", | ||
| 64 | - "baked_in_configs/gvt1_com.json", | ||
| 65 | - "baked_in_configs/gvt2_com.json", | ||
| 66 | - "baked_in_configs/gvt6_com.json", | ||
| 67 | - "baked_in_configs/ssl_gstatic_com.json", | ||
| 68 | - "baked_in_configs/www_google_com.json", | ||
| 69 | ] | ||
| 70 | |||
| 71 | output_file = "$target_gen_dir/baked_in_configs.cc" | ||
| 72 | @@ -34,13 +14,21 @@ action("bake_in_configs") { | ||
| 73 | |||
| 74 | # The JSON file list is too long for the command line on Windows, so put | ||
| 75 | # them in a response file. | ||
| 76 | - response_file_contents = rebase_path(inputs, root_build_dir) | ||
| 77 | - args = [ | ||
| 78 | - "--file-list", | ||
| 79 | - "{{response_file_name}}", | ||
| 80 | - "--output", | ||
| 81 | - rebase_path(output_file, root_build_dir), | ||
| 82 | - ] | ||
| 83 | + if (is_win) { | ||
| 84 | + args = [ | ||
| 85 | + "--file-list", | ||
| 86 | + "nul", | ||
| 87 | + "--output", | ||
| 88 | + rebase_path(output_file, root_build_dir), | ||
| 89 | + ] | ||
| 90 | + } else { | ||
| 91 | + args = [ | ||
| 92 | + "--file-list", | ||
| 93 | + "/dev/null", | ||
| 94 | + "--output", | ||
| 95 | + rebase_path(output_file, root_build_dir), | ||
| 96 | + ] | ||
| 97 | + } | ||
| 98 | } | ||
| 99 | |||
| 100 | component("domain_reliability") { | ||
| 101 | --- components/domain_reliability/bake_in_configs.py.orig | ||
| 102 | +++ components/domain_reliability/bake_in_configs.py | ||
| 103 | @@ -490,7 +490,7 @@ def origin_is_whitelisted(origin): | ||
| 104 | domain = origin[8:-1] | ||
| 105 | else: | ||
| 106 | return False | ||
| 107 | - return any(domain == e or domain.endswith('.' + e) for e in DOMAIN_WHITELIST) | ||
| 108 | + return False | ||
| 109 | |||
| 110 | |||
| 111 | def quote_and_wrap_text(text, width=79, prefix=' "', suffix='"'): | ||
| 112 | --- components/domain_reliability/google_configs.cc.orig | ||
| 113 | +++ components/domain_reliability/google_configs.cc | ||
| 114 | @@ -11,564 +11,6 @@ | ||
| 115 | |||
| 116 | namespace domain_reliability { | ||
| 117 | |||
| 118 | -namespace { | ||
| 119 | - | ||
| 120 | -struct GoogleConfigParams { | ||
| 121 | - const char* hostname; | ||
| 122 | - bool include_subdomains; | ||
| 123 | - | ||
| 124 | - // If true, prepend a collector URL within https://|hostname|/. | ||
| 125 | - bool include_origin_specific_collector; | ||
| 126 | - | ||
| 127 | - // If true, also add a config for www.|hostname|. | ||
| 128 | - // | ||
| 129 | - // |include_subdomains| will be false in the extra config, but | ||
| 130 | - // |include_origin_specific_collector| will be respected, and will use the | ||
| 131 | - // www subdomain as the origin for the collector so it matches the config. | ||
| 132 | - bool duplicate_for_www; | ||
| 133 | -}; | ||
| 134 | - | ||
| 135 | -const GoogleConfigParams kGoogleConfigs[] = { | ||
| 136 | - // Origins with subdomains and same-origin collectors. Currently, all | ||
| 137 | - // origins with same-origin collectors also run collectors on their www | ||
| 138 | - // subdomain. (e.g., both foo.com and www.foo.com.) | ||
| 139 | - {"google.ac", true, true, true}, | ||
| 140 | - {"google.ad", true, true, true}, | ||
| 141 | - {"google.ae", true, true, true}, | ||
| 142 | - {"google.af", true, true, true}, | ||
| 143 | - {"google.ag", true, true, true}, | ||
| 144 | - {"google.al", true, true, true}, | ||
| 145 | - {"google.am", true, true, true}, | ||
| 146 | - {"google.as", true, true, true}, | ||
| 147 | - {"google.at", true, true, true}, | ||
| 148 | - {"google.az", true, true, true}, | ||
| 149 | - {"google.ba", true, true, true}, | ||
| 150 | - {"google.be", true, true, true}, | ||
| 151 | - {"google.bf", true, true, true}, | ||
| 152 | - {"google.bg", true, true, true}, | ||
| 153 | - {"google.bi", true, true, true}, | ||
| 154 | - {"google.bj", true, true, true}, | ||
| 155 | - {"google.bs", true, true, true}, | ||
| 156 | - {"google.bt", true, true, true}, | ||
| 157 | - {"google.by", true, true, true}, | ||
| 158 | - {"google.ca", true, true, true}, | ||
| 159 | - {"google.cc", true, true, true}, | ||
| 160 | - {"google.cd", true, true, true}, | ||
| 161 | - {"google.cf", true, true, true}, | ||
| 162 | - {"google.cg", true, true, true}, | ||
| 163 | - {"google.ch", true, true, true}, | ||
| 164 | - {"google.ci", true, true, true}, | ||
| 165 | - {"google.cl", true, true, true}, | ||
| 166 | - {"google.cm", true, true, true}, | ||
| 167 | - {"google.cn", true, true, true}, | ||
| 168 | - {"google.co.ao", true, true, true}, | ||
| 169 | - {"google.co.bw", true, true, true}, | ||
| 170 | - {"google.co.ck", true, true, true}, | ||
| 171 | - {"google.co.cr", true, true, true}, | ||
| 172 | - {"google.co.hu", true, true, true}, | ||
| 173 | - {"google.co.id", true, true, true}, | ||
| 174 | - {"google.co.il", true, true, true}, | ||
| 175 | - {"google.co.im", true, true, true}, | ||
| 176 | - {"google.co.in", true, true, true}, | ||
| 177 | - {"google.co.je", true, true, true}, | ||
| 178 | - {"google.co.jp", true, true, true}, | ||
| 179 | - {"google.co.ke", true, true, true}, | ||
| 180 | - {"google.co.kr", true, true, true}, | ||
| 181 | - {"google.co.ls", true, true, true}, | ||
| 182 | - {"google.co.ma", true, true, true}, | ||
| 183 | - {"google.co.mz", true, true, true}, | ||
| 184 | - {"google.co.nz", true, true, true}, | ||
| 185 | - {"google.co.th", true, true, true}, | ||
| 186 | - {"google.co.tz", true, true, true}, | ||
| 187 | - {"google.co.ug", true, true, true}, | ||
| 188 | - {"google.co.uk", true, true, true}, | ||
| 189 | - {"google.co.uz", true, true, true}, | ||
| 190 | - {"google.co.ve", true, true, true}, | ||
| 191 | - {"google.co.vi", true, true, true}, | ||
| 192 | - {"google.co.za", true, true, true}, | ||
| 193 | - {"google.co.zm", true, true, true}, | ||
| 194 | - {"google.co.zw", true, true, true}, | ||
| 195 | - {"google.com.af", true, true, true}, | ||
| 196 | - {"google.com.ag", true, true, true}, | ||
| 197 | - {"google.com.ai", true, true, true}, | ||
| 198 | - {"google.com.ar", true, true, true}, | ||
| 199 | - {"google.com.au", true, true, true}, | ||
| 200 | - {"google.com.bd", true, true, true}, | ||
| 201 | - {"google.com.bh", true, true, true}, | ||
| 202 | - {"google.com.bn", true, true, true}, | ||
| 203 | - {"google.com.bo", true, true, true}, | ||
| 204 | - {"google.com.br", true, true, true}, | ||
| 205 | - {"google.com.by", true, true, true}, | ||
| 206 | - {"google.com.bz", true, true, true}, | ||
| 207 | - {"google.com.cn", true, true, true}, | ||
| 208 | - {"google.com.co", true, true, true}, | ||
| 209 | - {"google.com.cu", true, true, true}, | ||
| 210 | - {"google.com.cy", true, true, true}, | ||
| 211 | - {"google.com.do", true, true, true}, | ||
| 212 | - {"google.com.ec", true, true, true}, | ||
| 213 | - {"google.com.eg", true, true, true}, | ||
| 214 | - {"google.com.et", true, true, true}, | ||
| 215 | - {"google.com.fj", true, true, true}, | ||
| 216 | - {"google.com.ge", true, true, true}, | ||
| 217 | - {"google.com.gh", true, true, true}, | ||
| 218 | - {"google.com.gi", true, true, true}, | ||
| 219 | - {"google.com.gr", true, true, true}, | ||
| 220 | - {"google.com.gt", true, true, true}, | ||
| 221 | - {"google.com.hk", true, true, true}, | ||
| 222 | - {"google.com.iq", true, true, true}, | ||
| 223 | - {"google.com.jm", true, true, true}, | ||
| 224 | - {"google.com.jo", true, true, true}, | ||
| 225 | - {"google.com.kh", true, true, true}, | ||
| 226 | - {"google.com.kw", true, true, true}, | ||
| 227 | - {"google.com.lb", true, true, true}, | ||
| 228 | - {"google.com.ly", true, true, true}, | ||
| 229 | - {"google.com.mm", true, true, true}, | ||
| 230 | - {"google.com.mt", true, true, true}, | ||
| 231 | - {"google.com.mx", true, true, true}, | ||
| 232 | - {"google.com.my", true, true, true}, | ||
| 233 | - {"google.com.na", true, true, true}, | ||
| 234 | - {"google.com.nf", true, true, true}, | ||
| 235 | - {"google.com.ng", true, true, true}, | ||
| 236 | - {"google.com.ni", true, true, true}, | ||
| 237 | - {"google.com.np", true, true, true}, | ||
| 238 | - {"google.com.nr", true, true, true}, | ||
| 239 | - {"google.com.om", true, true, true}, | ||
| 240 | - {"google.com.pa", true, true, true}, | ||
| 241 | - {"google.com.pe", true, true, true}, | ||
| 242 | - {"google.com.pg", true, true, true}, | ||
| 243 | - {"google.com.ph", true, true, true}, | ||
| 244 | - {"google.com.pk", true, true, true}, | ||
| 245 | - {"google.com.pl", true, true, true}, | ||
| 246 | - {"google.com.pr", true, true, true}, | ||
| 247 | - {"google.com.py", true, true, true}, | ||
| 248 | - {"google.com.qa", true, true, true}, | ||
| 249 | - {"google.com.ru", true, true, true}, | ||
| 250 | - {"google.com.sa", true, true, true}, | ||
| 251 | - {"google.com.sb", true, true, true}, | ||
| 252 | - {"google.com.sg", true, true, true}, | ||
| 253 | - {"google.com.sl", true, true, true}, | ||
| 254 | - {"google.com.sv", true, true, true}, | ||
| 255 | - {"google.com.tj", true, true, true}, | ||
| 256 | - {"google.com.tn", true, true, true}, | ||
| 257 | - {"google.com.tr", true, true, true}, | ||
| 258 | - {"google.com.tw", true, true, true}, | ||
| 259 | - {"google.com.ua", true, true, true}, | ||
| 260 | - {"google.com.uy", true, true, true}, | ||
| 261 | - {"google.com.vc", true, true, true}, | ||
| 262 | - {"google.com.ve", true, true, true}, | ||
| 263 | - {"google.com.vn", true, true, true}, | ||
| 264 | - {"google.cv", true, true, true}, | ||
| 265 | - {"google.cz", true, true, true}, | ||
| 266 | - {"google.de", true, true, true}, | ||
| 267 | - {"google.dj", true, true, true}, | ||
| 268 | - {"google.dk", true, true, true}, | ||
| 269 | - {"google.dm", true, true, true}, | ||
| 270 | - {"google.dz", true, true, true}, | ||
| 271 | - {"google.ee", true, true, true}, | ||
| 272 | - {"google.es", true, true, true}, | ||
| 273 | - {"google.fi", true, true, true}, | ||
| 274 | - {"google.fm", true, true, true}, | ||
| 275 | - {"google.fr", true, true, true}, | ||
| 276 | - {"google.ga", true, true, true}, | ||
| 277 | - {"google.ge", true, true, true}, | ||
| 278 | - {"google.gg", true, true, true}, | ||
| 279 | - {"google.gl", true, true, true}, | ||
| 280 | - {"google.gm", true, true, true}, | ||
| 281 | - {"google.gp", true, true, true}, | ||
| 282 | - {"google.gr", true, true, true}, | ||
| 283 | - {"google.gy", true, true, true}, | ||
| 284 | - {"google.hk", true, true, true}, | ||
| 285 | - {"google.hn", true, true, true}, | ||
| 286 | - {"google.hr", true, true, true}, | ||
| 287 | - {"google.ht", true, true, true}, | ||
| 288 | - {"google.hu", true, true, true}, | ||
| 289 | - {"google.ie", true, true, true}, | ||
| 290 | - {"google.im", true, true, true}, | ||
| 291 | - {"google.iq", true, true, true}, | ||
| 292 | - {"google.ir", true, true, true}, | ||
| 293 | - {"google.is", true, true, true}, | ||
| 294 | - {"google.it", true, true, true}, | ||
| 295 | - {"google.it.ao", true, true, true}, | ||
| 296 | - {"google.je", true, true, true}, | ||
| 297 | - {"google.jo", true, true, true}, | ||
| 298 | - {"google.jp", true, true, true}, | ||
| 299 | - {"google.kg", true, true, true}, | ||
| 300 | - {"google.ki", true, true, true}, | ||
| 301 | - {"google.kz", true, true, true}, | ||
| 302 | - {"google.la", true, true, true}, | ||
| 303 | - {"google.li", true, true, true}, | ||
| 304 | - {"google.lk", true, true, true}, | ||
| 305 | - {"google.lt", true, true, true}, | ||
| 306 | - {"google.lu", true, true, true}, | ||
| 307 | - {"google.lv", true, true, true}, | ||
| 308 | - {"google.md", true, true, true}, | ||
| 309 | - {"google.me", true, true, true}, | ||
| 310 | - {"google.mg", true, true, true}, | ||
| 311 | - {"google.mk", true, true, true}, | ||
| 312 | - {"google.ml", true, true, true}, | ||
| 313 | - {"google.mn", true, true, true}, | ||
| 314 | - {"google.ms", true, true, true}, | ||
| 315 | - {"google.mu", true, true, true}, | ||
| 316 | - {"google.mv", true, true, true}, | ||
| 317 | - {"google.mw", true, true, true}, | ||
| 318 | - {"google.ne", true, true, true}, | ||
| 319 | - {"google.ne.jp", true, true, true}, | ||
| 320 | - {"google.ng", true, true, true}, | ||
| 321 | - {"google.nl", true, true, true}, | ||
| 322 | - {"google.no", true, true, true}, | ||
| 323 | - {"google.nr", true, true, true}, | ||
| 324 | - {"google.nu", true, true, true}, | ||
| 325 | - {"google.off.ai", true, true, true}, | ||
| 326 | - {"google.pk", true, true, true}, | ||
| 327 | - {"google.pl", true, true, true}, | ||
| 328 | - {"google.pn", true, true, true}, | ||
| 329 | - {"google.ps", true, true, true}, | ||
| 330 | - {"google.pt", true, true, true}, | ||
| 331 | - {"google.ro", true, true, true}, | ||
| 332 | - {"google.rs", true, true, true}, | ||
| 333 | - {"google.ru", true, true, true}, | ||
| 334 | - {"google.rw", true, true, true}, | ||
| 335 | - {"google.sc", true, true, true}, | ||
| 336 | - {"google.se", true, true, true}, | ||
| 337 | - {"google.sh", true, true, true}, | ||
| 338 | - {"google.si", true, true, true}, | ||
| 339 | - {"google.sk", true, true, true}, | ||
| 340 | - {"google.sm", true, true, true}, | ||
| 341 | - {"google.sn", true, true, true}, | ||
| 342 | - {"google.so", true, true, true}, | ||
| 343 | - {"google.sr", true, true, true}, | ||
| 344 | - {"google.st", true, true, true}, | ||
| 345 | - {"google.td", true, true, true}, | ||
| 346 | - {"google.tg", true, true, true}, | ||
| 347 | - {"google.tk", true, true, true}, | ||
| 348 | - {"google.tl", true, true, true}, | ||
| 349 | - {"google.tm", true, true, true}, | ||
| 350 | - {"google.tn", true, true, true}, | ||
| 351 | - {"google.to", true, true, true}, | ||
| 352 | - {"google.tt", true, true, true}, | ||
| 353 | - {"google.us", true, true, true}, | ||
| 354 | - {"google.uz", true, true, true}, | ||
| 355 | - {"google.vg", true, true, true}, | ||
| 356 | - {"google.vu", true, true, true}, | ||
| 357 | - {"google.ws", true, true, true}, | ||
| 358 | - {"l.google.com", true, true, true}, | ||
| 359 | - | ||
| 360 | - // google.com is a special case. We have a custom config for www.google.com, | ||
| 361 | - // so set duplicate_for_www = false. | ||
| 362 | - {"google.com", true, true, false}, | ||
| 363 | - | ||
| 364 | - // Origins with subdomains and without same-origin collectors. | ||
| 365 | - {"2mdn.net", true, false, false}, | ||
| 366 | - {"adgoogle.net", true, false, false}, | ||
| 367 | - {"admeld.com", true, false, false}, | ||
| 368 | - {"admob.biz", true, false, false}, | ||
| 369 | - {"admob.co.in", true, false, false}, | ||
| 370 | - {"admob.co.kr", true, false, false}, | ||
| 371 | - {"admob.co.nz", true, false, false}, | ||
| 372 | - {"admob.co.uk", true, false, false}, | ||
| 373 | - {"admob.co.za", true, false, false}, | ||
| 374 | - {"admob.com", true, false, false}, | ||
| 375 | - {"admob.com.br", true, false, false}, | ||
| 376 | - {"admob.com.es", true, false, false}, | ||
| 377 | - {"admob.com.fr", true, false, false}, | ||
| 378 | - {"admob.com.mx", true, false, false}, | ||
| 379 | - {"admob.com.pt", true, false, false}, | ||
| 380 | - {"admob.de", true, false, false}, | ||
| 381 | - {"admob.dk", true, false, false}, | ||
| 382 | - {"admob.es", true, false, false}, | ||
| 383 | - {"admob.fi", true, false, false}, | ||
| 384 | - {"admob.fr", true, false, false}, | ||
| 385 | - {"admob.gr", true, false, false}, | ||
| 386 | - {"admob.hk", true, false, false}, | ||
| 387 | - {"admob.ie", true, false, false}, | ||
| 388 | - {"admob.in", true, false, false}, | ||
| 389 | - {"admob.it", true, false, false}, | ||
| 390 | - {"admob.jp", true, false, false}, | ||
| 391 | - {"admob.kr", true, false, false}, | ||
| 392 | - {"admob.mobi", true, false, false}, | ||
| 393 | - {"admob.no", true, false, false}, | ||
| 394 | - {"admob.ph", true, false, false}, | ||
| 395 | - {"admob.pt", true, false, false}, | ||
| 396 | - {"admob.sg", true, false, false}, | ||
| 397 | - {"admob.tw", true, false, false}, | ||
| 398 | - {"admob.us", true, false, false}, | ||
| 399 | - {"admob.vn", true, false, false}, | ||
| 400 | - {"adwhirl.com", true, false, false}, | ||
| 401 | - {"ampproject.com", true, false, false}, | ||
| 402 | - {"ampproject.net", true, false, false}, | ||
| 403 | - {"ampproject.org", true, false, false}, | ||
| 404 | - {"android.com", true, false, false}, | ||
| 405 | - {"anycast-edge.metric.gstatic.com", true, false, false}, | ||
| 406 | - {"anycast-stb.metric.gstatic.com", true, false, false}, | ||
| 407 | - {"anycast.metric.gstatic.com", true, false, false}, | ||
| 408 | - {"cdn.ampproject.org", true, false, false}, | ||
| 409 | - {"chromecast.com", true, false, false}, | ||
| 410 | - {"chromeexperiments.com", true, false, false}, | ||
| 411 | - {"chromestatus.com", true, false, false}, | ||
| 412 | - {"chromium.org", true, false, false}, | ||
| 413 | - {"clients6.google.com", true, false, false}, | ||
| 414 | - {"cloudendpointsapis.com", true, false, false}, | ||
| 415 | - {"dartmotif.com", true, false, false}, | ||
| 416 | - {"dartsearch.net", true, false, false}, | ||
| 417 | - {"doubleclick.com", true, false, false}, | ||
| 418 | - {"doubleclick.ne.jp", true, false, false}, | ||
| 419 | - {"doubleclick.net", true, false, false}, | ||
| 420 | - {"doubleclickusercontent.com", true, false, false}, | ||
| 421 | - {"fls.doubleclick.net", true, false, false}, | ||
| 422 | - {"g.co", true, false, false}, | ||
| 423 | - {"g.doubleclick.net", true, false, false}, | ||
| 424 | - {"ggpht.com", true, false, false}, | ||
| 425 | - {"gmodules.com", true, false, false}, | ||
| 426 | - {"goo.gl", true, false, false}, | ||
| 427 | - {"google-syndication.com", true, false, false}, | ||
| 428 | - {"google.cat", true, false, false}, | ||
| 429 | - {"google.info", true, false, false}, | ||
| 430 | - {"google.jobs", true, false, false}, | ||
| 431 | - {"google.net", true, false, false}, | ||
| 432 | - {"google.org", true, false, false}, | ||
| 433 | - {"google.stackdriver.com", true, false, false}, | ||
| 434 | - {"googleadapis.com", true, false, false}, | ||
| 435 | - {"googleadservices.com", true, false, false}, | ||
| 436 | - {"googleadsserving.cn", true, false, false}, | ||
| 437 | - {"googlealumni.com", true, false, false}, | ||
| 438 | - {"googleapis.cn", true, false, false}, | ||
| 439 | - {"googleapis.com", true, false, false}, | ||
| 440 | - {"googleapps.com", true, false, false}, | ||
| 441 | - {"googlecbs.com", true, false, false}, | ||
| 442 | - {"googlecode.com", true, false, false}, | ||
| 443 | - {"googlecommerce.com", true, false, false}, | ||
| 444 | - {"googledrive.com", true, false, false}, | ||
| 445 | - {"googleenterprise.com", true, false, false}, | ||
| 446 | - {"googlefiber.com", true, false, false}, | ||
| 447 | - {"googlefiber.net", true, false, false}, | ||
| 448 | - {"googlegoro.com", true, false, false}, | ||
| 449 | - {"googlehosted.com", true, false, false}, | ||
| 450 | - {"googlepayments.com", true, false, false}, | ||
| 451 | - {"googlesource.com", true, false, false}, | ||
| 452 | - {"googlesyndication.com", true, false, false}, | ||
| 453 | - {"googletagmanager.com", true, false, false}, | ||
| 454 | - {"googletagservices.com", true, false, false}, | ||
| 455 | - {"googleusercontent.com", true, false, false}, | ||
| 456 | - {"googlezip.net", true, false, false}, | ||
| 457 | - {"gstatic.cn", true, false, false}, | ||
| 458 | - {"gstatic.com", true, false, false}, | ||
| 459 | - {"gvt3.com", true, false, false}, | ||
| 460 | - {"gvt9.com", true, false, false}, | ||
| 461 | - {"picasa.com", true, false, false}, | ||
| 462 | - {"recaptcha.net", true, false, false}, | ||
| 463 | - {"stackdriver.com", true, false, false}, | ||
| 464 | - {"stbcast-stb.metric.gstatic.com", true, false, false}, | ||
| 465 | - {"stbcast.metric.gstatic.com", true, false, false}, | ||
| 466 | - {"stbcast2-stb.metric.gstatic.com", true, false, false}, | ||
| 467 | - {"stbcast2.metric.gstatic.com", true, false, false}, | ||
| 468 | - {"stbcast3-stb.metric.gstatic.com", true, false, false}, | ||
| 469 | - {"stbcast3.metric.gstatic.com", true, false, false}, | ||
| 470 | - {"stbcast4-stb.metric.gstatic.com", true, false, false}, | ||
| 471 | - {"stbcast4.metric.gstatic.com", true, false, false}, | ||
| 472 | - {"unicast-edge.metric.gstatic.com", true, false, false}, | ||
| 473 | - {"unicast-stb.metric.gstatic.com", true, false, false}, | ||
| 474 | - {"unicast.metric.gstatic.com", true, false, false}, | ||
| 475 | - {"unicast2-stb.metric.gstatic.com", true, false, false}, | ||
| 476 | - {"unicast2.metric.gstatic.com", true, false, false}, | ||
| 477 | - {"waze.com", true, false, false}, | ||
| 478 | - {"withgoogle.com", true, false, false}, | ||
| 479 | - {"youtu.be", true, false, false}, | ||
| 480 | - {"youtube-3rd-party.com", true, false, false}, | ||
| 481 | - {"youtube-nocookie.com", true, false, false}, | ||
| 482 | - {"youtube.ae", true, false, false}, | ||
| 483 | - {"youtube.al", true, false, false}, | ||
| 484 | - {"youtube.am", true, false, false}, | ||
| 485 | - {"youtube.at", true, false, false}, | ||
| 486 | - {"youtube.az", true, false, false}, | ||
| 487 | - {"youtube.ba", true, false, false}, | ||
| 488 | - {"youtube.be", true, false, false}, | ||
| 489 | - {"youtube.bg", true, false, false}, | ||
| 490 | - {"youtube.bh", true, false, false}, | ||
| 491 | - {"youtube.bo", true, false, false}, | ||
| 492 | - {"youtube.ca", true, false, false}, | ||
| 493 | - {"youtube.cat", true, false, false}, | ||
| 494 | - {"youtube.ch", true, false, false}, | ||
| 495 | - {"youtube.cl", true, false, false}, | ||
| 496 | - {"youtube.co", true, false, false}, | ||
| 497 | - {"youtube.co.ae", true, false, false}, | ||
| 498 | - {"youtube.co.at", true, false, false}, | ||
| 499 | - {"youtube.co.hu", true, false, false}, | ||
| 500 | - {"youtube.co.id", true, false, false}, | ||
| 501 | - {"youtube.co.il", true, false, false}, | ||
| 502 | - {"youtube.co.in", true, false, false}, | ||
| 503 | - {"youtube.co.jp", true, false, false}, | ||
| 504 | - {"youtube.co.ke", true, false, false}, | ||
| 505 | - {"youtube.co.kr", true, false, false}, | ||
| 506 | - {"youtube.co.ma", true, false, false}, | ||
| 507 | - {"youtube.co.nz", true, false, false}, | ||
| 508 | - {"youtube.co.th", true, false, false}, | ||
| 509 | - {"youtube.co.ug", true, false, false}, | ||
| 510 | - {"youtube.co.uk", true, false, false}, | ||
| 511 | - {"youtube.co.ve", true, false, false}, | ||
| 512 | - {"youtube.co.za", true, false, false}, | ||
| 513 | - {"youtube.com", true, false, false}, | ||
| 514 | - {"youtube.com.ar", true, false, false}, | ||
| 515 | - {"youtube.com.au", true, false, false}, | ||
| 516 | - {"youtube.com.az", true, false, false}, | ||
| 517 | - {"youtube.com.bh", true, false, false}, | ||
| 518 | - {"youtube.com.bo", true, false, false}, | ||
| 519 | - {"youtube.com.br", true, false, false}, | ||
| 520 | - {"youtube.com.by", true, false, false}, | ||
| 521 | - {"youtube.com.co", true, false, false}, | ||
| 522 | - {"youtube.com.do", true, false, false}, | ||
| 523 | - {"youtube.com.ee", true, false, false}, | ||
| 524 | - {"youtube.com.eg", true, false, false}, | ||
| 525 | - {"youtube.com.es", true, false, false}, | ||
| 526 | - {"youtube.com.gh", true, false, false}, | ||
| 527 | - {"youtube.com.gr", true, false, false}, | ||
| 528 | - {"youtube.com.gt", true, false, false}, | ||
| 529 | - {"youtube.com.hk", true, false, false}, | ||
| 530 | - {"youtube.com.hr", true, false, false}, | ||
| 531 | - {"youtube.com.jm", true, false, false}, | ||
| 532 | - {"youtube.com.jo", true, false, false}, | ||
| 533 | - {"youtube.com.kw", true, false, false}, | ||
| 534 | - {"youtube.com.lb", true, false, false}, | ||
| 535 | - {"youtube.com.lv", true, false, false}, | ||
| 536 | - {"youtube.com.mk", true, false, false}, | ||
| 537 | - {"youtube.com.mt", true, false, false}, | ||
| 538 | - {"youtube.com.mx", true, false, false}, | ||
| 539 | - {"youtube.com.my", true, false, false}, | ||
| 540 | - {"youtube.com.ng", true, false, false}, | ||
| 541 | - {"youtube.com.om", true, false, false}, | ||
| 542 | - {"youtube.com.pe", true, false, false}, | ||
| 543 | - {"youtube.com.ph", true, false, false}, | ||
| 544 | - {"youtube.com.pk", true, false, false}, | ||
| 545 | - {"youtube.com.pt", true, false, false}, | ||
| 546 | - {"youtube.com.qa", true, false, false}, | ||
| 547 | - {"youtube.com.ro", true, false, false}, | ||
| 548 | - {"youtube.com.sa", true, false, false}, | ||
| 549 | - {"youtube.com.sg", true, false, false}, | ||
| 550 | - {"youtube.com.tn", true, false, false}, | ||
| 551 | - {"youtube.com.tr", true, false, false}, | ||
| 552 | - {"youtube.com.tw", true, false, false}, | ||
| 553 | - {"youtube.com.ua", true, false, false}, | ||
| 554 | - {"youtube.com.uy", true, false, false}, | ||
| 555 | - {"youtube.com.ve", true, false, false}, | ||
| 556 | - {"youtube.cz", true, false, false}, | ||
| 557 | - {"youtube.de", true, false, false}, | ||
| 558 | - {"youtube.dk", true, false, false}, | ||
| 559 | - {"youtube.ee", true, false, false}, | ||
| 560 | - {"youtube.es", true, false, false}, | ||
| 561 | - {"youtube.fi", true, false, false}, | ||
| 562 | - {"youtube.fr", true, false, false}, | ||
| 563 | - {"youtube.ge", true, false, false}, | ||
| 564 | - {"youtube.gr", true, false, false}, | ||
| 565 | - {"youtube.gt", true, false, false}, | ||
| 566 | - {"youtube.hk", true, false, false}, | ||
| 567 | - {"youtube.hr", true, false, false}, | ||
| 568 | - {"youtube.hu", true, false, false}, | ||
| 569 | - {"youtube.ie", true, false, false}, | ||
| 570 | - {"youtube.in", true, false, false}, | ||
| 571 | - {"youtube.is", true, false, false}, | ||
| 572 | - {"youtube.it", true, false, false}, | ||
| 573 | - {"youtube.jo", true, false, false}, | ||
| 574 | - {"youtube.jp", true, false, false}, | ||
| 575 | - {"youtube.kr", true, false, false}, | ||
| 576 | - {"youtube.lk", true, false, false}, | ||
| 577 | - {"youtube.lt", true, false, false}, | ||
| 578 | - {"youtube.lv", true, false, false}, | ||
| 579 | - {"youtube.ma", true, false, false}, | ||
| 580 | - {"youtube.md", true, false, false}, | ||
| 581 | - {"youtube.me", true, false, false}, | ||
| 582 | - {"youtube.mk", true, false, false}, | ||
| 583 | - {"youtube.mx", true, false, false}, | ||
| 584 | - {"youtube.my", true, false, false}, | ||
| 585 | - {"youtube.ng", true, false, false}, | ||
| 586 | - {"youtube.nl", true, false, false}, | ||
| 587 | - {"youtube.no", true, false, false}, | ||
| 588 | - {"youtube.pe", true, false, false}, | ||
| 589 | - {"youtube.ph", true, false, false}, | ||
| 590 | - {"youtube.pk", true, false, false}, | ||
| 591 | - {"youtube.pl", true, false, false}, | ||
| 592 | - {"youtube.pr", true, false, false}, | ||
| 593 | - {"youtube.pt", true, false, false}, | ||
| 594 | - {"youtube.qa", true, false, false}, | ||
| 595 | - {"youtube.ro", true, false, false}, | ||
| 596 | - {"youtube.rs", true, false, false}, | ||
| 597 | - {"youtube.ru", true, false, false}, | ||
| 598 | - {"youtube.sa", true, false, false}, | ||
| 599 | - {"youtube.se", true, false, false}, | ||
| 600 | - {"youtube.sg", true, false, false}, | ||
| 601 | - {"youtube.si", true, false, false}, | ||
| 602 | - {"youtube.sk", true, false, false}, | ||
| 603 | - {"youtube.sn", true, false, false}, | ||
| 604 | - {"youtube.tn", true, false, false}, | ||
| 605 | - {"youtube.ua", true, false, false}, | ||
| 606 | - {"youtube.ug", true, false, false}, | ||
| 607 | - {"youtube.uy", true, false, false}, | ||
| 608 | - {"youtube.vn", true, false, false}, | ||
| 609 | - {"youtubeeducation.com", true, false, false}, | ||
| 610 | - {"youtubemobilesupport.com", true, false, false}, | ||
| 611 | - {"ytimg.com", true, false, false}, | ||
| 612 | - | ||
| 613 | - // Origins without subdomains and with same-origin collectors. | ||
| 614 | - {"accounts.google.com", false, true, false}, | ||
| 615 | - {"apis.google.com", false, true, false}, | ||
| 616 | - {"app.google.stackdriver.com", false, true, false}, | ||
| 617 | - {"b.mail.google.com", false, true, false}, | ||
| 618 | - {"chatenabled.mail.google.com", false, true, false}, | ||
| 619 | - {"ddm.google.com", false, true, false}, | ||
| 620 | - {"gmail.com", false, true, false}, | ||
| 621 | - {"gmail.google.com", false, true, false}, | ||
| 622 | - {"mail-attachment.googleusercontent.com", false, true, false}, | ||
| 623 | - {"mail.google.com", false, true, false}, | ||
| 624 | - {"www.gmail.com", false, true, false}, | ||
| 625 | - | ||
| 626 | - // Origins without subdomains or same-origin collectors. | ||
| 627 | - {"ad.doubleclick.net", false, false, false}, | ||
| 628 | - {"drive.google.com", false, false, false}, | ||
| 629 | - {"redirector.googlevideo.com", false, false, false}, | ||
| 630 | -}; | ||
| 631 | - | ||
| 632 | -const char* const kGoogleStandardCollectors[] = { | ||
| 633 | - "https://beacons.gcp.gvt2.com/domainreliability/upload", | ||
| 634 | - "https://beacons.gvt2.com/domainreliability/upload", | ||
| 635 | - "https://beacons2.gvt2.com/domainreliability/upload", | ||
| 636 | - "https://beacons3.gvt2.com/domainreliability/upload", | ||
| 637 | - "https://beacons4.gvt2.com/domainreliability/upload", | ||
| 638 | - "https://beacons5.gvt2.com/domainreliability/upload", | ||
| 639 | - "https://beacons5.gvt3.com/domainreliability/upload", | ||
| 640 | - "https://clients2.google.com/domainreliability/upload", | ||
| 641 | -}; | ||
| 642 | - | ||
| 643 | -const char* const kGoogleOriginSpecificCollectorPathString = | ||
| 644 | - "/domainreliability/upload"; | ||
| 645 | - | ||
| 646 | -std::unique_ptr<const DomainReliabilityConfig> CreateGoogleConfig( | ||
| 647 | - const GoogleConfigParams& params, | ||
| 648 | - bool is_www) { | ||
| 649 | - if (is_www) | ||
| 650 | - DCHECK(params.duplicate_for_www); | ||
| 651 | - | ||
| 652 | - std::string hostname = (is_www ? "www." : "") + std::string(params.hostname); | ||
| 653 | - bool include_subdomains = params.include_subdomains && !is_www; | ||
| 654 | - | ||
| 655 | - auto config = std::make_unique<DomainReliabilityConfig>(); | ||
| 656 | - config->origin = GURL("https://" + hostname + "/"); | ||
| 657 | - config->include_subdomains = include_subdomains; | ||
| 658 | - config->collectors.clear(); | ||
| 659 | - if (params.include_origin_specific_collector) { | ||
| 660 | - GURL::Replacements replacements; | ||
| 661 | - replacements.SetPathStr(kGoogleOriginSpecificCollectorPathString); | ||
| 662 | - config->collectors.push_back( | ||
| 663 | - std::make_unique<GURL>(config->origin.ReplaceComponents(replacements))); | ||
| 664 | - } | ||
| 665 | - for (const char* collector : kGoogleStandardCollectors) { | ||
| 666 | - config->collectors.push_back(std::make_unique<GURL>(collector)); | ||
| 667 | - } | ||
| 668 | - config->success_sample_rate = 0.05; | ||
| 669 | - config->failure_sample_rate = 1.00; | ||
| 670 | - config->path_prefixes.clear(); | ||
| 671 | - return config; | ||
| 672 | -} | ||
| 673 | - | ||
| 674 | -} // namespace | ||
| 675 | - | ||
| 676 | std::unique_ptr<const DomainReliabilityConfig> MaybeGetGoogleConfig( | ||
| 677 | const std::string& hostname) { | ||
| 678 | bool is_www_subdomain = | ||
| 679 | @@ -578,23 +20,6 @@ std::unique_ptr<const DomainReliabilityC | ||
| 680 | std::unique_ptr<const DomainReliabilityConfig> config; | ||
| 681 | std::unique_ptr<const DomainReliabilityConfig> superdomain_config; | ||
| 682 | |||
| 683 | - for (const auto& params : kGoogleConfigs) { | ||
| 684 | - if (params.hostname == hostname) { | ||
| 685 | - config = CreateGoogleConfig(params, false); | ||
| 686 | - break; | ||
| 687 | - } | ||
| 688 | - if (params.duplicate_for_www && is_www_subdomain && | ||
| 689 | - params.hostname == hostname_parent) { | ||
| 690 | - config = CreateGoogleConfig(params, true); | ||
| 691 | - break; | ||
| 692 | - } | ||
| 693 | - // Don't break out of the loop upon finding a superdomain config, because | ||
| 694 | - // there might be an exact match later on. | ||
| 695 | - if (params.include_subdomains && params.hostname == hostname_parent) { | ||
| 696 | - superdomain_config = CreateGoogleConfig(params, false); | ||
| 697 | - } | ||
| 698 | - } | ||
| 699 | - | ||
| 700 | if (config) { | ||
| 701 | DCHECK(config->origin.host() == hostname); | ||
| 702 | return config; | ||
| 703 | @@ -613,11 +38,6 @@ std::vector<std::unique_ptr<const Domain | ||
| 704 | GetAllGoogleConfigsForTesting() { | ||
| 705 | std::vector<std::unique_ptr<const DomainReliabilityConfig>> configs_out; | ||
| 706 | |||
| 707 | - for (const auto& params : kGoogleConfigs) { | ||
| 708 | - configs_out.push_back(CreateGoogleConfig(params, false)); | ||
| 709 | - if (params.duplicate_for_www) | ||
| 710 | - configs_out.push_back(CreateGoogleConfig(params, true)); | ||
| 711 | - } | ||
| 712 | return configs_out; | ||
| 713 | } | ||
| 714 | |||
| 715 | --- components/domain_reliability/uploader.cc.orig | ||
| 716 | +++ components/domain_reliability/uploader.cc | ||
| 717 | @@ -79,7 +79,7 @@ class DomainReliabilityUploaderImpl : pu | ||
| 718 | if (discard_uploads_) | ||
| 719 | discarded_upload_count_++; | ||
| 720 | |||
| 721 | - if (discard_uploads_ || shutdown_) { | ||
| 722 | + if (true) { | ||
| 723 | DVLOG(1) << "Discarding report instead of uploading."; | ||
| 724 | UploadResult result; | ||
| 725 | result.status = UploadResult::SUCCESS; | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/disable-floc.patch b/www/chromium-uc/patches/core/ungoogled-chromium/disable-floc.patch new file mode 100644 index 0000000..3ef84c2 --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/disable-floc.patch | |||
| @@ -0,0 +1,78 @@ | |||
| 1 | --- chrome/browser/federated_learning/floc_id_provider_factory.cc.orig | ||
| 2 | +++ chrome/browser/federated_learning/floc_id_provider_factory.cc | ||
| 3 | @@ -49,42 +49,7 @@ FlocIdProviderFactory::~FlocIdProviderFa | ||
| 4 | |||
| 5 | KeyedService* FlocIdProviderFactory::BuildServiceInstanceFor( | ||
| 6 | content::BrowserContext* context) const { | ||
| 7 | - if (!base::FeatureList::IsEnabled(kFederatedLearningOfCohorts)) | ||
| 8 | - return nullptr; | ||
| 9 | - | ||
| 10 | - Profile* profile = Profile::FromBrowserContext(context); | ||
| 11 | - | ||
| 12 | - syncer::SyncService* sync_service = | ||
| 13 | - SyncServiceFactory::GetForProfile(profile); | ||
| 14 | - if (!sync_service) | ||
| 15 | - return nullptr; | ||
| 16 | - | ||
| 17 | - PrivacySandboxSettings* privacy_sandbox_settings = | ||
| 18 | - PrivacySandboxSettingsFactory::GetForProfile(profile); | ||
| 19 | - if (!privacy_sandbox_settings) | ||
| 20 | - return nullptr; | ||
| 21 | - | ||
| 22 | - FlocRemotePermissionService* floc_remote_permission_service = | ||
| 23 | - FlocRemotePermissionServiceFactory::GetForProfile(profile); | ||
| 24 | - if (!floc_remote_permission_service) | ||
| 25 | - return nullptr; | ||
| 26 | - | ||
| 27 | - history::HistoryService* history_service = | ||
| 28 | - HistoryServiceFactory::GetForProfile(profile, | ||
| 29 | - ServiceAccessType::IMPLICIT_ACCESS); | ||
| 30 | - if (!history_service) | ||
| 31 | - return nullptr; | ||
| 32 | - | ||
| 33 | - syncer::UserEventService* user_event_service = | ||
| 34 | - browser_sync::UserEventServiceFactory::GetForProfile(profile); | ||
| 35 | - if (!user_event_service) | ||
| 36 | - return nullptr; | ||
| 37 | - | ||
| 38 | - auto floc_event_logger = std::make_unique<FlocEventLogger>( | ||
| 39 | - sync_service, floc_remote_permission_service, user_event_service); | ||
| 40 | - | ||
| 41 | - return new FlocIdProviderImpl(profile->GetPrefs(), privacy_sandbox_settings, | ||
| 42 | - history_service, std::move(floc_event_logger)); | ||
| 43 | + return nullptr; | ||
| 44 | } | ||
| 45 | |||
| 46 | } // namespace federated_learning | ||
| 47 | --- chrome/browser/privacy_sandbox/privacy_sandbox_settings.cc.orig | ||
| 48 | +++ chrome/browser/privacy_sandbox/privacy_sandbox_settings.cc | ||
| 49 | @@ -132,8 +132,7 @@ bool ShouldDisablePrivacySandbox( | ||
| 50 | |||
| 51 | // Returns whether FLoC is allowable by the current state of |pref_service|. | ||
| 52 | bool IsFlocAllowedByPrefs(PrefService* pref_service) { | ||
| 53 | - return pref_service->GetBoolean(prefs::kPrivacySandboxFlocEnabled) && | ||
| 54 | - pref_service->GetBoolean(prefs::kPrivacySandboxApisEnabled); | ||
| 55 | + return false; | ||
| 56 | } | ||
| 57 | |||
| 58 | // Returns the number of days in |time|, rounded to the closest day by hour if | ||
| 59 | @@ -207,7 +206,7 @@ PrivacySandboxSettings::PrivacySandboxSe | ||
| 60 | PrivacySandboxSettings::~PrivacySandboxSettings() = default; | ||
| 61 | |||
| 62 | bool PrivacySandboxSettings::IsFlocAllowed() const { | ||
| 63 | - return IsFlocAllowedByPrefs(pref_service_); | ||
| 64 | + return false; | ||
| 65 | } | ||
| 66 | |||
| 67 | bool PrivacySandboxSettings::IsFlocAllowedForContext( | ||
| 68 | --- components/privacy_sandbox/privacy_sandbox_prefs.cc.orig | ||
| 69 | +++ components/privacy_sandbox/privacy_sandbox_prefs.cc | ||
| 70 | @@ -42,7 +42,7 @@ void RegisterProfilePrefs(PrefRegistrySi | ||
| 71 | registry->RegisterTimePref(prefs::kPrivacySandboxFlocDataAccessibleSince, | ||
| 72 | base::Time()); | ||
| 73 | registry->RegisterBooleanPref( | ||
| 74 | - prefs::kPrivacySandboxFlocEnabled, true, | ||
| 75 | + prefs::kPrivacySandboxFlocEnabled, false, | ||
| 76 | user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | ||
| 77 | } | ||
| 78 | |||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/disable-fonts-googleapis-references.patch b/www/chromium-uc/patches/core/ungoogled-chromium/disable-fonts-googleapis-references.patch new file mode 100644 index 0000000..e969364 --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/disable-fonts-googleapis-references.patch | |||
| @@ -0,0 +1,121 @@ | |||
| 1 | # Disables references to fonts.googleapis.com | ||
| 2 | |||
| 3 | --- chrome/browser/ash/child_accounts/time_limits/web_time_limit_error_page/resources/web_time_limit_error_page.html.orig | ||
| 4 | +++ chrome/browser/ash/child_accounts/time_limits/web_time_limit_error_page/resources/web_time_limit_error_page.html | ||
| 5 | @@ -5,7 +5,7 @@ | ||
| 6 | <meta name="viewport" | ||
| 7 | content="initial-scale=1, minimum-scale=1,width=device-width"> | ||
| 8 | <title>$i18n{blockPageTitle}</title> | ||
| 9 | -<link href="https://fonts.googleapis.com/css?family=Google+Sans" rel="stylesheet"> | ||
| 10 | +<link href="chrome://resources/css/roboto.css" rel="stylesheet"> | ||
| 11 | <link rel="stylesheet" href="../../../../../../../components/security_interstitials/core/common/resources/interstitial_core.css"> | ||
| 12 | <link rel="stylesheet" href="../../../../../supervised_user/supervised_user_error_page/resources/supervised_user_block_interstitial.css"> | ||
| 13 | </head> | ||
| 14 | --- chrome/browser/resources/chromeos/accessibility/chromevox/options/options.css.orig | ||
| 15 | +++ chrome/browser/resources/chromeos/accessibility/chromevox/options/options.css | ||
| 16 | @@ -2,7 +2,7 @@ | ||
| 17 | * Use of this source code is governed by a BSD-style license that can be | ||
| 18 | * found in the LICENSE file. */ | ||
| 19 | |||
| 20 | -@import url(https://fonts.googleapis.com/css?family=Roboto); | ||
| 21 | +@import url(chrome://resources/css/roboto.css); | ||
| 22 | |||
| 23 | body { | ||
| 24 | margin: 0 0 20px 0; | ||
| 25 | --- chrome/browser/resources/chromeos/accessibility/select_to_speak/options.css.orig | ||
| 26 | +++ chrome/browser/resources/chromeos/accessibility/select_to_speak/options.css | ||
| 27 | @@ -2,7 +2,7 @@ | ||
| 28 | * Use of this source code is governed by a BSD-style license that can be | ||
| 29 | * found in the LICENSE file. */ | ||
| 30 | |||
| 31 | -@import url(https://fonts.googleapis.com/css?family=Roboto); | ||
| 32 | +@import url(chrome://resources/css/roboto.css); | ||
| 33 | |||
| 34 | body { | ||
| 35 | margin: 0 0 20px 0; | ||
| 36 | --- chrome/browser/supervised_user/supervised_user_error_page/resources/supervised_user_block_interstitial.html.orig | ||
| 37 | +++ chrome/browser/supervised_user/supervised_user_error_page/resources/supervised_user_block_interstitial.html | ||
| 38 | @@ -5,7 +5,7 @@ | ||
| 39 | <meta name="viewport" | ||
| 40 | content="initial-scale=1, minimum-scale=1, width=device-width"> | ||
| 41 | <title>$i18n{blockPageTitle}</title> | ||
| 42 | -<link href="https://fonts.googleapis.com/css?family=Google+Sans" rel="stylesheet"> | ||
| 43 | +<link href="chrome://resources/css/roboto.css" rel="stylesheet"> | ||
| 44 | <link rel="stylesheet" href="../../../../../components/security_interstitials/core/common/resources/interstitial_core.css"> | ||
| 45 | <link rel="stylesheet" href="supervised_user_block_interstitial.css"> | ||
| 46 | <script src="../../../../../ui/webui/resources/js/cr.js"></script> | ||
| 47 | --- components/dom_distiller/content/browser/dom_distiller_viewer_source.cc.orig | ||
| 48 | +++ components/dom_distiller/content/browser/dom_distiller_viewer_source.cc | ||
| 49 | @@ -300,7 +300,7 @@ bool DomDistillerViewerSource::ShouldSer | ||
| 50 | std::string DomDistillerViewerSource::GetContentSecurityPolicy( | ||
| 51 | network::mojom::CSPDirectiveName directive) { | ||
| 52 | if (directive == network::mojom::CSPDirectiveName::StyleSrc) { | ||
| 53 | - return "style-src 'self' https://fonts.googleapis.com;"; | ||
| 54 | + return "style-src 'self';"; | ||
| 55 | } else if (directive == network::mojom::CSPDirectiveName::ChildSrc) { | ||
| 56 | return "child-src *;"; | ||
| 57 | } else if (directive == | ||
| 58 | --- components/dom_distiller/core/html/preview.html.orig | ||
| 59 | +++ components/dom_distiller/core/html/preview.html | ||
| 60 | @@ -11,7 +11,7 @@ found in the LICENSE file. | ||
| 61 | <meta name="theme-color" id="theme-color"> | ||
| 62 | <title>Title goes here and it could be kind of lengthy - Publisher name</title> | ||
| 63 | <link href="../css/distilledpage.css" rel="stylesheet" type="text/css"> | ||
| 64 | - <link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'> | ||
| 65 | + <link href='chrome://resources/css/roboto.css' rel='stylesheet' type='text/css'> | ||
| 66 | <style> | ||
| 67 | .english :lang(th) {display: none} | ||
| 68 | .english :lang(zh) {display: none} | ||
| 69 | --- components/dom_distiller/core/javascript/dom_distiller_viewer.js.orig | ||
| 70 | +++ components/dom_distiller/core/javascript/dom_distiller_viewer.js | ||
| 71 | @@ -109,7 +109,7 @@ function maybeSetWebFont() { | ||
| 72 | } | ||
| 73 | |||
| 74 | const e = document.createElement('link'); | ||
| 75 | - e.href = 'https://fonts.googleapis.com/css?family=Roboto'; | ||
| 76 | + e.href = 'chrome://resources/css/roboto.css'; | ||
| 77 | e.rel = 'stylesheet'; | ||
| 78 | e.type = 'text/css'; | ||
| 79 | document.head.appendChild(e); | ||
| 80 | --- third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css.orig | ||
| 81 | +++ third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css | ||
| 82 | @@ -12,8 +12,7 @@ | ||
| 83 | * See the License for the specific language governing permissions and | ||
| 84 | * limitations under the License. */ | ||
| 85 | |||
| 86 | -@import "https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset=latin,cyrillic-ext,greek-ext,cyrillic,greek,vietnamese,latin-ext"; | ||
| 87 | -@import "https://fonts.googleapis.com/css?family=Source+Code+Pro"; | ||
| 88 | +@import "chrome://resources/css/roboto.css"; | ||
| 89 | |||
| 90 | body, | ||
| 91 | table, | ||
| 92 | --- tools/md_browser/base.css.orig | ||
| 93 | +++ tools/md_browser/base.css | ||
| 94 | @@ -16,8 +16,7 @@ | ||
| 95 | |||
| 96 | /* Common styles and definitions. */ | ||
| 97 | |||
| 98 | -@import "//fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset=latin,cyrillic-ext,greek-ext,cyrillic,greek,vietnamese,latin-ext"; | ||
| 99 | -@import "//fonts.googleapis.com/css?family=Source+Code+Pro"; | ||
| 100 | +@import "chrome://resources/css/roboto.css"; | ||
| 101 | *, | ||
| 102 | *::after, | ||
| 103 | *::before { | ||
| 104 | @@ -72,7 +71,7 @@ ul, ol { | ||
| 105 | user-select: none; | ||
| 106 | } | ||
| 107 | .u-monospace { | ||
| 108 | - font-family: 'Source Code Pro', monospace; | ||
| 109 | + font-family: monospace; | ||
| 110 | } | ||
| 111 | |||
| 112 | /* Common.soy */ | ||
| 113 | @@ -82,7 +81,7 @@ ul, ol { | ||
| 114 | color: #000; | ||
| 115 | display: -ms-flexbox; | ||
| 116 | display: flex; | ||
| 117 | - font: 14px/1.54 'Open Sans', sans-serif; | ||
| 118 | + font: 14px/1.54 'Roboto', sans-serif; | ||
| 119 | min-height: 100vh; | ||
| 120 | -ms-flex-direction: column; | ||
| 121 | flex-direction: column; | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/disable-gaia.patch b/www/chromium-uc/patches/core/ungoogled-chromium/disable-gaia.patch new file mode 100644 index 0000000..bc27e5d --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/disable-gaia.patch | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | # Disables Gaia code | ||
| 2 | # Somehow it is still activated even without being signed-in: https://github.com/Eloston/ungoogled-chromium/issues/104 | ||
| 3 | |||
| 4 | --- google_apis/gaia/gaia_auth_fetcher.cc.orig | ||
| 5 | +++ google_apis/gaia/gaia_auth_fetcher.cc | ||
| 6 | @@ -293,65 +293,6 @@ void GaiaAuthFetcher::CreateAndStartGaia | ||
| 7 | network::mojom::CredentialsMode credentials_mode, | ||
| 8 | const net::NetworkTrafficAnnotationTag& traffic_annotation) { | ||
| 9 | DCHECK(!fetch_pending_) << "Tried to fetch two things at once!"; | ||
| 10 | - | ||
| 11 | - auto resource_request = std::make_unique<network::ResourceRequest>(); | ||
| 12 | - resource_request->url = gaia_gurl; | ||
| 13 | - original_url_ = gaia_gurl; | ||
| 14 | - | ||
| 15 | - if (credentials_mode != network::mojom::CredentialsMode::kOmit) { | ||
| 16 | - DCHECK_EQ(GaiaUrls::GetInstance()->gaia_url(), gaia_gurl.GetOrigin()) | ||
| 17 | - << gaia_gurl; | ||
| 18 | - url::Origin origin = | ||
| 19 | - url::Origin::Create(GaiaUrls::GetInstance()->gaia_url()); | ||
| 20 | - resource_request->site_for_cookies = | ||
| 21 | - net::SiteForCookies::FromOrigin(origin); | ||
| 22 | - resource_request->trusted_params = | ||
| 23 | - network::ResourceRequest::TrustedParams(); | ||
| 24 | - resource_request->trusted_params->isolation_info = | ||
| 25 | - net::IsolationInfo::CreateForInternalRequest(origin); | ||
| 26 | - } | ||
| 27 | - | ||
| 28 | - if (!body.empty()) | ||
| 29 | - resource_request->method = "POST"; | ||
| 30 | - | ||
| 31 | - if (!headers.empty()) | ||
| 32 | - resource_request->headers.AddHeadersFromString(headers); | ||
| 33 | - | ||
| 34 | - // The Gaia token exchange requests do not require any cookie-based | ||
| 35 | - // identification as part of requests. We suppress sending any cookies to | ||
| 36 | - // maintain a separation between the user's browsing and Chrome's internal | ||
| 37 | - // services. Where such mixing is desired (MergeSession or OAuthLogin), it | ||
| 38 | - // will be done explicitly. | ||
| 39 | - resource_request->credentials_mode = credentials_mode; | ||
| 40 | - | ||
| 41 | - url_loader_ = network::SimpleURLLoader::Create(std::move(resource_request), | ||
| 42 | - traffic_annotation); | ||
| 43 | - if (!body.empty()) { | ||
| 44 | - DCHECK(!body_content_type.empty()); | ||
| 45 | - url_loader_->AttachStringForUpload(body, body_content_type); | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - url_loader_->SetAllowHttpErrorResults(true); | ||
| 49 | - | ||
| 50 | - VLOG(2) << "Gaia fetcher URL: " << gaia_gurl.spec(); | ||
| 51 | - VLOG(2) << "Gaia fetcher headers: " << headers; | ||
| 52 | - VLOG(2) << "Gaia fetcher body: " << body; | ||
| 53 | - | ||
| 54 | - // Fetchers are sometimes cancelled because a network change was detected, | ||
| 55 | - // especially at startup and after sign-in on ChromeOS. Retrying once should | ||
| 56 | - // be enough in those cases; let the fetcher retry up to 3 times just in case. | ||
| 57 | - // http://crbug.com/163710 | ||
| 58 | - url_loader_->SetRetryOptions( | ||
| 59 | - 3, network::SimpleURLLoader::RETRY_ON_NETWORK_CHANGE); | ||
| 60 | - | ||
| 61 | - fetch_pending_ = true; | ||
| 62 | - | ||
| 63 | - // Unretained is OK below as |url_loader_| is owned by this. | ||
| 64 | - url_loader_->DownloadToString( | ||
| 65 | - url_loader_factory_.get(), | ||
| 66 | - base::BindOnce(&GaiaAuthFetcher::OnURLLoadComplete, | ||
| 67 | - base::Unretained(this)), | ||
| 68 | - kMaxMessageSize); | ||
| 69 | } | ||
| 70 | |||
| 71 | // static | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/disable-gcm.patch b/www/chromium-uc/patches/core/ungoogled-chromium/disable-gcm.patch new file mode 100644 index 0000000..bafa024 --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/disable-gcm.patch | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | # Disable Google Cloud Messaging (GCM) client | ||
| 2 | |||
| 3 | --- components/gcm_driver/gcm_client_impl.cc.orig | ||
| 4 | +++ components/gcm_driver/gcm_client_impl.cc | ||
| 5 | @@ -465,6 +465,7 @@ void GCMClientImpl::StartGCM() { | ||
| 6 | |||
| 7 | void GCMClientImpl::InitializeMCSClient() { | ||
| 8 | DCHECK(network_connection_tracker_); | ||
| 9 | + return; | ||
| 10 | std::vector<GURL> endpoints; | ||
| 11 | endpoints.push_back(gservices_settings_.GetMCSMainEndpoint()); | ||
| 12 | GURL fallback_endpoint = gservices_settings_.GetMCSFallbackEndpoint(); | ||
| 13 | @@ -670,27 +671,6 @@ void GCMClientImpl::RemoveHeartbeatInter | ||
| 14 | |||
| 15 | void GCMClientImpl::StartCheckin() { | ||
| 16 | DCHECK(io_task_runner_->RunsTasksInCurrentSequence()); | ||
| 17 | - | ||
| 18 | - // Make sure no checkin is in progress. | ||
| 19 | - if (checkin_request_) | ||
| 20 | - return; | ||
| 21 | - | ||
| 22 | - checkin_proto::ChromeBuildProto chrome_build_proto; | ||
| 23 | - ToCheckinProtoVersion(chrome_build_info_, &chrome_build_proto); | ||
| 24 | - CheckinRequest::RequestInfo request_info(device_checkin_info_.android_id, | ||
| 25 | - device_checkin_info_.secret, | ||
| 26 | - device_checkin_info_.account_tokens, | ||
| 27 | - gservices_settings_.digest(), | ||
| 28 | - chrome_build_proto); | ||
| 29 | - checkin_request_ = std::make_unique<CheckinRequest>( | ||
| 30 | - gservices_settings_.GetCheckinURL(), request_info, GetGCMBackoffPolicy(), | ||
| 31 | - base::BindOnce(&GCMClientImpl::OnCheckinCompleted, | ||
| 32 | - weak_ptr_factory_.GetWeakPtr()), | ||
| 33 | - url_loader_factory_, io_task_runner_, &recorder_); | ||
| 34 | - // Taking a snapshot of the accounts count here, as there might be an asynch | ||
| 35 | - // update of the account tokens while checkin is in progress. | ||
| 36 | - device_checkin_info_.SnapshotCheckinAccounts(); | ||
| 37 | - checkin_request_->Start(); | ||
| 38 | } | ||
| 39 | |||
| 40 | void GCMClientImpl::OnCheckinCompleted( | ||
| 41 | @@ -747,24 +727,6 @@ void GCMClientImpl::SetGServicesSettings | ||
| 42 | |||
| 43 | void GCMClientImpl::SchedulePeriodicCheckin() { | ||
| 44 | DCHECK(io_task_runner_->RunsTasksInCurrentSequence()); | ||
| 45 | - | ||
| 46 | - // Make sure no checkin is in progress. | ||
| 47 | - if (checkin_request_.get() || !device_checkin_info_.accounts_set) | ||
| 48 | - return; | ||
| 49 | - | ||
| 50 | - // There should be only one periodic checkin pending at a time. Removing | ||
| 51 | - // pending periodic checkin to schedule a new one. | ||
| 52 | - periodic_checkin_ptr_factory_.InvalidateWeakPtrs(); | ||
| 53 | - | ||
| 54 | - base::TimeDelta time_to_next_checkin = GetTimeToNextCheckin(); | ||
| 55 | - if (time_to_next_checkin < base::TimeDelta()) | ||
| 56 | - time_to_next_checkin = base::TimeDelta(); | ||
| 57 | - | ||
| 58 | - io_task_runner_->PostDelayedTask( | ||
| 59 | - FROM_HERE, | ||
| 60 | - base::BindOnce(&GCMClientImpl::StartCheckin, | ||
| 61 | - periodic_checkin_ptr_factory_.GetWeakPtr()), | ||
| 62 | - time_to_next_checkin); | ||
| 63 | } | ||
| 64 | |||
| 65 | base::TimeDelta GCMClientImpl::GetTimeToNextCheckin() const { | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/disable-google-host-detection.patch b/www/chromium-uc/patches/core/ungoogled-chromium/disable-google-host-detection.patch new file mode 100644 index 0000000..846904d --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/disable-google-host-detection.patch | |||
| @@ -0,0 +1,613 @@ | |||
| 1 | # Disables various detections of Google hosts and functionality specific to them | ||
| 2 | |||
| 3 | --- chrome/common/google_url_loader_throttle.cc.orig | ||
| 4 | +++ chrome/common/google_url_loader_throttle.cc | ||
| 5 | @@ -19,10 +19,6 @@ | ||
| 6 | #include "ui/base/device_form_factor.h" | ||
| 7 | #endif | ||
| 8 | |||
| 9 | -#if BUILDFLAG(ENABLE_EXTENSIONS) | ||
| 10 | -#include "extensions/common/extension_urls.h" | ||
| 11 | -#endif | ||
| 12 | - | ||
| 13 | namespace { | ||
| 14 | |||
| 15 | #if defined(OS_ANDROID) | ||
| 16 | @@ -65,52 +61,6 @@ void GoogleURLLoaderThrottle::DetachFrom | ||
| 17 | void GoogleURLLoaderThrottle::WillStartRequest( | ||
| 18 | network::ResourceRequest* request, | ||
| 19 | bool* defer) { | ||
| 20 | - if (dynamic_params_.force_safe_search) { | ||
| 21 | - GURL new_url; | ||
| 22 | - safe_search_util::ForceGoogleSafeSearch(request->url, &new_url); | ||
| 23 | - if (!new_url.is_empty()) | ||
| 24 | - request->url = new_url; | ||
| 25 | - } | ||
| 26 | - | ||
| 27 | - static_assert(safe_search_util::YOUTUBE_RESTRICT_OFF == 0, | ||
| 28 | - "OFF must be first"); | ||
| 29 | - if (dynamic_params_.youtube_restrict > | ||
| 30 | - safe_search_util::YOUTUBE_RESTRICT_OFF && | ||
| 31 | - dynamic_params_.youtube_restrict < | ||
| 32 | - safe_search_util::YOUTUBE_RESTRICT_COUNT) { | ||
| 33 | - safe_search_util::ForceYouTubeRestrict( | ||
| 34 | - request->url, &request->cors_exempt_headers, | ||
| 35 | - static_cast<safe_search_util::YouTubeRestrictMode>( | ||
| 36 | - dynamic_params_.youtube_restrict)); | ||
| 37 | - } | ||
| 38 | - | ||
| 39 | - if (!dynamic_params_.allowed_domains_for_apps.empty() && | ||
| 40 | - request->url.DomainIs("google.com")) { | ||
| 41 | - request->cors_exempt_headers.SetHeader( | ||
| 42 | - safe_search_util::kGoogleAppsAllowedDomains, | ||
| 43 | - dynamic_params_.allowed_domains_for_apps); | ||
| 44 | - } | ||
| 45 | - | ||
| 46 | -#if defined(OS_ANDROID) | ||
| 47 | - if (!client_data_header_.empty() && | ||
| 48 | - google_util::IsGoogleAssociatedDomainUrl(request->url)) { | ||
| 49 | - request->cors_exempt_headers.SetHeader(kCCTClientDataHeader, | ||
| 50 | - client_data_header_); | ||
| 51 | - } | ||
| 52 | - | ||
| 53 | - bool is_google_homepage_or_search = | ||
| 54 | - google_util::IsGoogleHomePageUrl(request->url) || | ||
| 55 | - google_util::IsGoogleSearchUrl(request->url); | ||
| 56 | - if (is_google_homepage_or_search) { | ||
| 57 | - if (base::FeatureList::IsEnabled(features::kRequestDesktopSiteForTablets) && | ||
| 58 | - ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET) { | ||
| 59 | - request->headers.SetHeader(kRequestDesktopDataHeader, | ||
| 60 | - is_tab_large_enough_ ? "1" : "0"); | ||
| 61 | - base::UmaHistogramBoolean("Android.RequestDesktopSite.TabletEligible", | ||
| 62 | - is_tab_large_enough_); | ||
| 63 | - } | ||
| 64 | - } | ||
| 65 | -#endif | ||
| 66 | } | ||
| 67 | |||
| 68 | void GoogleURLLoaderThrottle::WillRedirectRequest( | ||
| 69 | @@ -120,37 +70,6 @@ void GoogleURLLoaderThrottle::WillRedire | ||
| 70 | std::vector<std::string>* to_be_removed_headers, | ||
| 71 | net::HttpRequestHeaders* modified_headers, | ||
| 72 | net::HttpRequestHeaders* modified_cors_exempt_headers) { | ||
| 73 | - // URLLoaderThrottles can only change the redirect URL when the network | ||
| 74 | - // service is enabled. The non-network service path handles this in | ||
| 75 | - // ChromeNetworkDelegate. | ||
| 76 | - if (dynamic_params_.force_safe_search) { | ||
| 77 | - safe_search_util::ForceGoogleSafeSearch(redirect_info->new_url, | ||
| 78 | - &redirect_info->new_url); | ||
| 79 | - } | ||
| 80 | - | ||
| 81 | - if (dynamic_params_.youtube_restrict > | ||
| 82 | - safe_search_util::YOUTUBE_RESTRICT_OFF && | ||
| 83 | - dynamic_params_.youtube_restrict < | ||
| 84 | - safe_search_util::YOUTUBE_RESTRICT_COUNT) { | ||
| 85 | - safe_search_util::ForceYouTubeRestrict( | ||
| 86 | - redirect_info->new_url, modified_cors_exempt_headers, | ||
| 87 | - static_cast<safe_search_util::YouTubeRestrictMode>( | ||
| 88 | - dynamic_params_.youtube_restrict)); | ||
| 89 | - } | ||
| 90 | - | ||
| 91 | - if (!dynamic_params_.allowed_domains_for_apps.empty() && | ||
| 92 | - redirect_info->new_url.DomainIs("google.com")) { | ||
| 93 | - modified_cors_exempt_headers->SetHeader( | ||
| 94 | - safe_search_util::kGoogleAppsAllowedDomains, | ||
| 95 | - dynamic_params_.allowed_domains_for_apps); | ||
| 96 | - } | ||
| 97 | - | ||
| 98 | -#if defined(OS_ANDROID) | ||
| 99 | - if (!client_data_header_.empty() && | ||
| 100 | - !google_util::IsGoogleAssociatedDomainUrl(redirect_info->new_url)) { | ||
| 101 | - to_be_removed_headers->push_back(kCCTClientDataHeader); | ||
| 102 | - } | ||
| 103 | -#endif | ||
| 104 | } | ||
| 105 | |||
| 106 | #if BUILDFLAG(ENABLE_EXTENSIONS) | ||
| 107 | @@ -158,23 +77,5 @@ void GoogleURLLoaderThrottle::WillProces | ||
| 108 | const GURL& response_url, | ||
| 109 | network::mojom::URLResponseHead* response_head, | ||
| 110 | bool* defer) { | ||
| 111 | - // Built-in additional protection for the chrome web store origin by ensuring | ||
| 112 | - // that the X-Frame-Options protection mechanism is set to either DENY or | ||
| 113 | - // SAMEORIGIN. | ||
| 114 | - GURL webstore_url(extension_urls::GetWebstoreLaunchURL()); | ||
| 115 | - if (response_url.SchemeIsHTTPOrHTTPS() && | ||
| 116 | - response_url.DomainIs(webstore_url.host_piece())) { | ||
| 117 | - // TODO(mkwst): Consider shifting this to a NavigationThrottle rather than | ||
| 118 | - // relying on implicit ordering between this check and the time at which | ||
| 119 | - // ParsedHeaders is created. | ||
| 120 | - CHECK(response_head); | ||
| 121 | - CHECK(response_head->parsed_headers); | ||
| 122 | - if (response_head->parsed_headers->xfo != | ||
| 123 | - network::mojom::XFrameOptionsValue::kDeny) { | ||
| 124 | - response_head->headers->SetHeader("X-Frame-Options", "SAMEORIGIN"); | ||
| 125 | - response_head->parsed_headers->xfo = | ||
| 126 | - network::mojom::XFrameOptionsValue::kSameOrigin; | ||
| 127 | - } | ||
| 128 | - } | ||
| 129 | } | ||
| 130 | #endif | ||
| 131 | --- components/google/core/common/google_util.cc.orig | ||
| 132 | +++ components/google/core/common/google_util.cc | ||
| 133 | @@ -33,112 +33,6 @@ namespace google_util { | ||
| 134 | |||
| 135 | namespace { | ||
| 136 | |||
| 137 | -bool IsPathHomePageBase(base::StringPiece path) { | ||
| 138 | - return (path == "/") || (path == "/webhp"); | ||
| 139 | -} | ||
| 140 | - | ||
| 141 | -// Removes a single trailing dot if present in |host|. | ||
| 142 | -void StripTrailingDot(base::StringPiece* host) { | ||
| 143 | - if (base::EndsWith(*host, ".")) | ||
| 144 | - host->remove_suffix(1); | ||
| 145 | -} | ||
| 146 | - | ||
| 147 | -// True if the given canonical |host| is "[www.]<domain_in_lower_case>.<TLD>" | ||
| 148 | -// with a valid TLD that appears in |allowed_tlds|. If |subdomain_permission| is | ||
| 149 | -// ALLOW_SUBDOMAIN, we check against host "*.<domain_in_lower_case>.<TLD>" | ||
| 150 | -// instead. | ||
| 151 | -template <typename Container> | ||
| 152 | -bool IsValidHostName(base::StringPiece host, | ||
| 153 | - base::StringPiece domain_in_lower_case, | ||
| 154 | - SubdomainPermission subdomain_permission, | ||
| 155 | - const Container& allowed_tlds) { | ||
| 156 | - // Fast path to avoid searching the registry set. | ||
| 157 | - if (host.find(domain_in_lower_case) == base::StringPiece::npos) | ||
| 158 | - return false; | ||
| 159 | - | ||
| 160 | - size_t tld_length = | ||
| 161 | - net::registry_controlled_domains::GetCanonicalHostRegistryLength( | ||
| 162 | - host, net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES, | ||
| 163 | - net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES); | ||
| 164 | - if ((tld_length == 0) || (tld_length == std::string::npos)) | ||
| 165 | - return false; | ||
| 166 | - | ||
| 167 | - // Removes the tld and the preceding dot. | ||
| 168 | - base::StringPiece host_minus_tld = | ||
| 169 | - host.substr(0, host.length() - tld_length - 1); | ||
| 170 | - | ||
| 171 | - base::StringPiece tld = host.substr(host.length() - tld_length); | ||
| 172 | - // Remove the trailing dot from tld if present, as for Google domains it's the | ||
| 173 | - // same page. | ||
| 174 | - StripTrailingDot(&tld); | ||
| 175 | - if (!allowed_tlds.contains(tld)) | ||
| 176 | - return false; | ||
| 177 | - | ||
| 178 | - if (base::LowerCaseEqualsASCII(host_minus_tld, domain_in_lower_case)) | ||
| 179 | - return true; | ||
| 180 | - | ||
| 181 | - if (subdomain_permission == ALLOW_SUBDOMAIN) { | ||
| 182 | - std::string dot_domain = base::StrCat({".", domain_in_lower_case}); | ||
| 183 | - return base::EndsWith(host_minus_tld, dot_domain, | ||
| 184 | - base::CompareCase::INSENSITIVE_ASCII); | ||
| 185 | - } | ||
| 186 | - | ||
| 187 | - std::string www_domain = base::StrCat({"www.", domain_in_lower_case}); | ||
| 188 | - return base::LowerCaseEqualsASCII(host_minus_tld, www_domain); | ||
| 189 | -} | ||
| 190 | - | ||
| 191 | -// True if |url| is a valid URL with HTTP or HTTPS scheme. If |port_permission| | ||
| 192 | -// is DISALLOW_NON_STANDARD_PORTS, this also requires |url| to use the standard | ||
| 193 | -// port for its scheme (80 for HTTP, 443 for HTTPS). | ||
| 194 | -bool IsValidURL(const GURL& url, PortPermission port_permission) { | ||
| 195 | - static bool g_ignore_port_numbers = | ||
| 196 | - base::CommandLine::ForCurrentProcess()->HasSwitch( | ||
| 197 | - switches::kIgnoreGooglePortNumbers); | ||
| 198 | - return url.is_valid() && url.SchemeIsHTTPOrHTTPS() && | ||
| 199 | - (url.port().empty() || g_ignore_port_numbers || | ||
| 200 | - (port_permission == ALLOW_NON_STANDARD_PORTS)); | ||
| 201 | -} | ||
| 202 | - | ||
| 203 | -bool IsCanonicalHostGoogleHostname(base::StringPiece canonical_host, | ||
| 204 | - SubdomainPermission subdomain_permission) { | ||
| 205 | - const GURL& base_url(CommandLineGoogleBaseURL()); | ||
| 206 | - if (base_url.is_valid() && (canonical_host == base_url.host_piece())) | ||
| 207 | - return true; | ||
| 208 | - | ||
| 209 | - static constexpr auto google_tlds = | ||
| 210 | - base::MakeFixedFlatSet<base::StringPiece>({GOOGLE_TLD_LIST}); | ||
| 211 | - return IsValidHostName(canonical_host, "google", subdomain_permission, | ||
| 212 | - google_tlds); | ||
| 213 | -} | ||
| 214 | - | ||
| 215 | -bool IsCanonicalHostYoutubeHostname(base::StringPiece canonical_host, | ||
| 216 | - SubdomainPermission subdomain_permission) { | ||
| 217 | - static constexpr auto youtube_tlds = | ||
| 218 | - base::MakeFixedFlatSet<base::StringPiece>({YOUTUBE_TLD_LIST}); | ||
| 219 | - | ||
| 220 | - return IsValidHostName(canonical_host, "youtube", subdomain_permission, | ||
| 221 | - youtube_tlds) || | ||
| 222 | - IsValidHostName(canonical_host, "youtubekids", subdomain_permission, | ||
| 223 | - youtube_tlds); | ||
| 224 | -} | ||
| 225 | - | ||
| 226 | -// True if |url| is a valid URL with a host that is in the static list of | ||
| 227 | -// Google subdomains for google search, and an HTTP or HTTPS scheme. Requires | ||
| 228 | -// |url| to use the standard port for its scheme (80 for HTTP, 443 for HTTPS). | ||
| 229 | -bool IsGoogleSearchSubdomainUrl(const GURL& url) { | ||
| 230 | - if (!IsValidURL(url, PortPermission::DISALLOW_NON_STANDARD_PORTS)) | ||
| 231 | - return false; | ||
| 232 | - | ||
| 233 | - base::StringPiece host(url.host_piece()); | ||
| 234 | - StripTrailingDot(&host); | ||
| 235 | - | ||
| 236 | - static constexpr auto google_subdomains = | ||
| 237 | - base::MakeFixedFlatSet<base::StringPiece>( | ||
| 238 | - {"ipv4.google.com", "ipv6.google.com"}); | ||
| 239 | - | ||
| 240 | - return google_subdomains.contains(host); | ||
| 241 | -} | ||
| 242 | - | ||
| 243 | } // namespace | ||
| 244 | |||
| 245 | // Global functions ----------------------------------------------------------- | ||
| 246 | @@ -146,12 +40,6 @@ bool IsGoogleSearchSubdomainUrl(const GU | ||
| 247 | const char kGoogleHomepageURL[] = "trk:113:https://www.google.com/"; | ||
| 248 | |||
| 249 | bool HasGoogleSearchQueryParam(base::StringPiece str) { | ||
| 250 | - url::Component query(0, static_cast<int>(str.length())), key, value; | ||
| 251 | - while (url::ExtractQueryKeyValue(str.data(), &query, &key, &value)) { | ||
| 252 | - base::StringPiece key_str = str.substr(key.begin, key.len); | ||
| 253 | - if (key_str == "q" || key_str == "as_q" || key_str == "imgurl") | ||
| 254 | - return true; | ||
| 255 | - } | ||
| 256 | return false; | ||
| 257 | } | ||
| 258 | |||
| 259 | @@ -162,161 +50,53 @@ std::string GetGoogleLocale(const std::s | ||
| 260 | |||
| 261 | GURL AppendGoogleLocaleParam(const GURL& url, | ||
| 262 | const std::string& application_locale) { | ||
| 263 | - return net::AppendQueryParameter(url, "hl", | ||
| 264 | - GetGoogleLocale(application_locale)); | ||
| 265 | + return url; | ||
| 266 | } | ||
| 267 | |||
| 268 | std::string GetGoogleCountryCode(const GURL& google_homepage_url) { | ||
| 269 | - base::StringPiece google_hostname = google_homepage_url.host_piece(); | ||
| 270 | - // TODO(igorcov): This needs a fix for case when the host has a trailing dot, | ||
| 271 | - // like "google.com./". https://crbug.com/720295. | ||
| 272 | - const size_t last_dot = google_hostname.find_last_of('.'); | ||
| 273 | - if (last_dot == std::string::npos) | ||
| 274 | - return std::string(); | ||
| 275 | - base::StringPiece country_code = google_hostname.substr(last_dot + 1); | ||
| 276 | - // Assume the com TLD implies the US. | ||
| 277 | - if (country_code == "com") | ||
| 278 | - return "us"; | ||
| 279 | - // Google uses the Unicode Common Locale Data Repository (CLDR), and the CLDR | ||
| 280 | - // code for the UK is "gb". | ||
| 281 | - if (country_code == "uk") | ||
| 282 | - return "gb"; | ||
| 283 | - // Catalonia does not have a CLDR country code, since it's a region in Spain, | ||
| 284 | - // so use Spain instead. | ||
| 285 | - if (country_code == "cat") | ||
| 286 | - return "es"; | ||
| 287 | - return std::string(country_code); | ||
| 288 | + return "nolocale"; | ||
| 289 | } | ||
| 290 | |||
| 291 | GURL GetGoogleSearchURL(const GURL& google_homepage_url) { | ||
| 292 | - // To transform the homepage URL into the corresponding search URL, add the | ||
| 293 | - // "search" and the "q=" query string. | ||
| 294 | - GURL::Replacements replacements; | ||
| 295 | - replacements.SetPathStr("search"); | ||
| 296 | - replacements.SetQueryStr("q="); | ||
| 297 | - return google_homepage_url.ReplaceComponents(replacements); | ||
| 298 | + return google_homepage_url; | ||
| 299 | } | ||
| 300 | |||
| 301 | const GURL& CommandLineGoogleBaseURL() { | ||
| 302 | - // Unit tests may add command-line flags after the first call to this | ||
| 303 | - // function, so we don't simply initialize a static |base_url| directly and | ||
| 304 | - // then unconditionally return it. | ||
| 305 | - static base::NoDestructor<std::string> switch_value; | ||
| 306 | static base::NoDestructor<GURL> base_url; | ||
| 307 | - std::string current_switch_value( | ||
| 308 | - base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | ||
| 309 | - switches::kGoogleBaseURL)); | ||
| 310 | - if (current_switch_value != *switch_value) { | ||
| 311 | - *switch_value = current_switch_value; | ||
| 312 | - *base_url = url_formatter::FixupURL(*switch_value, std::string()); | ||
| 313 | - if (!base_url->is_valid() || base_url->has_query() || base_url->has_ref()) | ||
| 314 | - *base_url = GURL(); | ||
| 315 | - } | ||
| 316 | + *base_url = GURL(); | ||
| 317 | return *base_url; | ||
| 318 | } | ||
| 319 | |||
| 320 | bool StartsWithCommandLineGoogleBaseURL(const GURL& url) { | ||
| 321 | - const GURL& base_url(CommandLineGoogleBaseURL()); | ||
| 322 | - return base_url.is_valid() && | ||
| 323 | - base::StartsWith(url.possibly_invalid_spec(), base_url.spec(), | ||
| 324 | - base::CompareCase::SENSITIVE); | ||
| 325 | + return false; | ||
| 326 | } | ||
| 327 | |||
| 328 | bool IsGoogleHostname(base::StringPiece host, | ||
| 329 | SubdomainPermission subdomain_permission) { | ||
| 330 | - url::CanonHostInfo host_info; | ||
| 331 | - return IsCanonicalHostGoogleHostname(net::CanonicalizeHost(host, &host_info), | ||
| 332 | - subdomain_permission); | ||
| 333 | + return false; | ||
| 334 | } | ||
| 335 | |||
| 336 | bool IsGoogleDomainUrl(const GURL& url, | ||
| 337 | SubdomainPermission subdomain_permission, | ||
| 338 | PortPermission port_permission) { | ||
| 339 | - return IsValidURL(url, port_permission) && | ||
| 340 | - IsCanonicalHostGoogleHostname(url.host_piece(), subdomain_permission); | ||
| 341 | + return false; | ||
| 342 | } | ||
| 343 | |||
| 344 | bool IsGoogleHomePageUrl(const GURL& url) { | ||
| 345 | - // First check to see if this has a Google domain. | ||
| 346 | - if (!IsGoogleDomainUrl(url, DISALLOW_SUBDOMAIN, | ||
| 347 | - DISALLOW_NON_STANDARD_PORTS) && | ||
| 348 | - !IsGoogleSearchSubdomainUrl(url)) { | ||
| 349 | - return false; | ||
| 350 | - } | ||
| 351 | - | ||
| 352 | - // Make sure the path is a known home page path. | ||
| 353 | - base::StringPiece path(url.path_piece()); | ||
| 354 | - return IsPathHomePageBase(path) || | ||
| 355 | - base::StartsWith(path, "/ig", base::CompareCase::INSENSITIVE_ASCII); | ||
| 356 | + return false; | ||
| 357 | } | ||
| 358 | |||
| 359 | bool IsGoogleSearchUrl(const GURL& url) { | ||
| 360 | - // First check to see if this has a Google domain. | ||
| 361 | - if (!IsGoogleDomainUrl(url, DISALLOW_SUBDOMAIN, | ||
| 362 | - DISALLOW_NON_STANDARD_PORTS) && | ||
| 363 | - !IsGoogleSearchSubdomainUrl(url)) { | ||
| 364 | - return false; | ||
| 365 | - } | ||
| 366 | - | ||
| 367 | - // Make sure the path is a known search path. | ||
| 368 | - base::StringPiece path(url.path_piece()); | ||
| 369 | - bool is_home_page_base = IsPathHomePageBase(path); | ||
| 370 | - if (!is_home_page_base && path != "/search" && path != "/imgres") | ||
| 371 | - return false; | ||
| 372 | - | ||
| 373 | - // Check for query parameter in URL parameter and hash fragment, depending on | ||
| 374 | - // the path type. | ||
| 375 | - return HasGoogleSearchQueryParam(url.ref_piece()) || | ||
| 376 | - (!is_home_page_base && HasGoogleSearchQueryParam(url.query_piece())); | ||
| 377 | + return false; | ||
| 378 | } | ||
| 379 | |||
| 380 | bool IsYoutubeDomainUrl(const GURL& url, | ||
| 381 | SubdomainPermission subdomain_permission, | ||
| 382 | PortPermission port_permission) { | ||
| 383 | - return IsValidURL(url, port_permission) && | ||
| 384 | - IsCanonicalHostYoutubeHostname(url.host_piece(), subdomain_permission); | ||
| 385 | + return false; | ||
| 386 | } | ||
| 387 | |||
| 388 | bool IsGoogleAssociatedDomainUrl(const GURL& url) { | ||
| 389 | - if (IsGoogleDomainUrl(url, ALLOW_SUBDOMAIN, ALLOW_NON_STANDARD_PORTS)) | ||
| 390 | - return true; | ||
| 391 | - | ||
| 392 | - if (IsYoutubeDomainUrl(url, ALLOW_SUBDOMAIN, ALLOW_NON_STANDARD_PORTS)) | ||
| 393 | - return true; | ||
| 394 | - | ||
| 395 | - // Some domains don't have international TLD extensions, so testing for them | ||
| 396 | - // is very straightforward. | ||
| 397 | - static const char* kSuffixesToSetHeadersFor[] = { | ||
| 398 | - ".android.com", | ||
| 399 | - ".doubleclick.com", | ||
| 400 | - ".doubleclick.net", | ||
| 401 | - ".ggpht.com", | ||
| 402 | - ".googleadservices.com", | ||
| 403 | - ".googleapis.com", | ||
| 404 | - ".googlesyndication.com", | ||
| 405 | - ".googleusercontent.com", | ||
| 406 | - ".googlevideo.com", | ||
| 407 | - ".gstatic.com", | ||
| 408 | - ".litepages.googlezip.net", | ||
| 409 | - ".ytimg.com", | ||
| 410 | - }; | ||
| 411 | - const std::string host = url.host(); | ||
| 412 | - for (size_t i = 0; i < base::size(kSuffixesToSetHeadersFor); ++i) { | ||
| 413 | - if (base::EndsWith(host, kSuffixesToSetHeadersFor[i], | ||
| 414 | - base::CompareCase::INSENSITIVE_ASCII)) { | ||
| 415 | - return true; | ||
| 416 | - } | ||
| 417 | - } | ||
| 418 | - | ||
| 419 | - // Exact hostnames in lowercase to set headers for. | ||
| 420 | - static const char* kHostsToSetHeadersFor[] = { | ||
| 421 | - "googleweblight.com", | ||
| 422 | - }; | ||
| 423 | - for (size_t i = 0; i < base::size(kHostsToSetHeadersFor); ++i) { | ||
| 424 | - if (base::LowerCaseEqualsASCII(host, kHostsToSetHeadersFor[i])) | ||
| 425 | - return true; | ||
| 426 | - } | ||
| 427 | - | ||
| 428 | return false; | ||
| 429 | } | ||
| 430 | |||
| 431 | --- components/page_load_metrics/browser/page_load_metrics_util.cc.orig | ||
| 432 | +++ components/page_load_metrics/browser/page_load_metrics_util.cc | ||
| 433 | @@ -196,9 +196,7 @@ bool DidObserveLoadingBehaviorInAnyFrame | ||
| 434 | } | ||
| 435 | |||
| 436 | bool IsGoogleSearchHostname(const GURL& url) { | ||
| 437 | - absl::optional<std::string> result = | ||
| 438 | - page_load_metrics::GetGoogleHostnamePrefix(url); | ||
| 439 | - return result && result.value() == "www"; | ||
| 440 | + return false; | ||
| 441 | } | ||
| 442 | |||
| 443 | bool IsGoogleSearchResultUrl(const GURL& url) { | ||
| 444 | --- components/page_load_metrics/common/page_load_metrics_util.cc.orig | ||
| 445 | +++ components/page_load_metrics/common/page_load_metrics_util.cc | ||
| 446 | @@ -36,38 +36,7 @@ const char* kBufferTimerDelayParamName = | ||
| 447 | } // namespace | ||
| 448 | |||
| 449 | absl::optional<std::string> GetGoogleHostnamePrefix(const GURL& url) { | ||
| 450 | - const size_t registry_length = | ||
| 451 | - net::registry_controlled_domains::GetRegistryLength( | ||
| 452 | - url, | ||
| 453 | - | ||
| 454 | - // Do not include unknown registries (registries that don't have any | ||
| 455 | - // matches in effective TLD names). | ||
| 456 | - net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES, | ||
| 457 | - | ||
| 458 | - // Do not include private registries, such as appspot.com. We don't | ||
| 459 | - // want to match URLs like www.google.appspot.com. | ||
| 460 | - net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES); | ||
| 461 | - | ||
| 462 | - const base::StringPiece hostname = url.host_piece(); | ||
| 463 | - if (registry_length == 0 || registry_length == std::string::npos || | ||
| 464 | - registry_length >= hostname.length()) { | ||
| 465 | - return absl::optional<std::string>(); | ||
| 466 | - } | ||
| 467 | - | ||
| 468 | - // Removes the tld and the preceding dot. | ||
| 469 | - const base::StringPiece hostname_minus_registry = | ||
| 470 | - hostname.substr(0, hostname.length() - (registry_length + 1)); | ||
| 471 | - | ||
| 472 | - if (hostname_minus_registry == "google") | ||
| 473 | - return std::string(""); | ||
| 474 | - | ||
| 475 | - if (!base::EndsWith(hostname_minus_registry, ".google", | ||
| 476 | - base::CompareCase::INSENSITIVE_ASCII)) { | ||
| 477 | - return absl::optional<std::string>(); | ||
| 478 | - } | ||
| 479 | - | ||
| 480 | - return std::string(hostname_minus_registry.substr( | ||
| 481 | - 0, hostname_minus_registry.length() - strlen(".google"))); | ||
| 482 | + return absl::optional<std::string>(); | ||
| 483 | } | ||
| 484 | |||
| 485 | bool IsGoogleHostname(const GURL& url) { | ||
| 486 | --- components/search_engines/template_url.cc.orig | ||
| 487 | +++ components/search_engines/template_url.cc | ||
| 488 | @@ -527,11 +527,7 @@ std::u16string TemplateURLRef::SearchTer | ||
| 489 | bool TemplateURLRef::HasGoogleBaseURLs( | ||
| 490 | const SearchTermsData& search_terms_data) const { | ||
| 491 | ParseIfNecessary(search_terms_data); | ||
| 492 | - return std::any_of(replacements_.begin(), replacements_.end(), | ||
| 493 | - [](const Replacement& replacement) { | ||
| 494 | - return replacement.type == GOOGLE_BASE_URL || | ||
| 495 | - replacement.type == GOOGLE_BASE_SUGGEST_URL; | ||
| 496 | - }); | ||
| 497 | + return false; | ||
| 498 | } | ||
| 499 | |||
| 500 | bool TemplateURLRef::ExtractSearchTermsFromURL( | ||
| 501 | --- components/variations/net/variations_http_headers.cc.orig | ||
| 502 | +++ components/variations/net/variations_http_headers.cc | ||
| 503 | @@ -26,10 +26,6 @@ | ||
| 504 | |||
| 505 | namespace variations { | ||
| 506 | |||
| 507 | -// The name string for the header for variations information. | ||
| 508 | -// Note that prior to M33 this header was named X-Chrome-Variations. | ||
| 509 | -const char kClientDataHeader[] = "X-Client-Data"; | ||
| 510 | - | ||
| 511 | namespace { | ||
| 512 | |||
| 513 | // The result of checking whether a request to a URL should have variations | ||
| 514 | @@ -238,29 +234,7 @@ class VariationsHeaderHelper { | ||
| 515 | VariationsHeaderHelper& operator=(const VariationsHeaderHelper&) = delete; | ||
| 516 | |||
| 517 | bool AppendHeaderIfNeeded(const GURL& url, InIncognito incognito) { | ||
| 518 | - AppendOmniboxOnDeviceSuggestionsHeaderIfNeeded(url, resource_request_); | ||
| 519 | - | ||
| 520 | - // Note the criteria for attaching client experiment headers: | ||
| 521 | - // 1. We only transmit to Google owned domains which can evaluate | ||
| 522 | - // experiments. | ||
| 523 | - // 1a. These include hosts which have a standard postfix such as: | ||
| 524 | - // *.doubleclick.net or *.googlesyndication.com or | ||
| 525 | - // exactly www.googleadservices.com or | ||
| 526 | - // international TLD domains *.google.<TLD> or *.youtube.<TLD>. | ||
| 527 | - // 2. Only transmit for non-Incognito profiles. | ||
| 528 | - // 3. For the X-Client-Data header, only include non-empty variation IDs. | ||
| 529 | - if ((incognito == InIncognito::kYes) || | ||
| 530 | - !ShouldAppendVariationsHeader(url, "Append")) | ||
| 531 | - return false; | ||
| 532 | - | ||
| 533 | - if (variations_header_.empty()) | ||
| 534 | - return false; | ||
| 535 | - | ||
| 536 | - // Set the variations header to cors_exempt_headers rather than headers | ||
| 537 | - // to be exempted from CORS checks. | ||
| 538 | - resource_request_->cors_exempt_headers.SetHeaderIfMissing( | ||
| 539 | - kClientDataHeader, variations_header_); | ||
| 540 | - return true; | ||
| 541 | + return false; | ||
| 542 | } | ||
| 543 | |||
| 544 | private: | ||
| 545 | @@ -328,8 +302,6 @@ void RemoveVariationsHeaderIfNeeded( | ||
| 546 | const net::RedirectInfo& redirect_info, | ||
| 547 | const network::mojom::URLResponseHead& response_head, | ||
| 548 | std::vector<std::string>* to_be_removed_headers) { | ||
| 549 | - if (!ShouldAppendVariationsHeader(redirect_info.new_url, "Remove")) | ||
| 550 | - to_be_removed_headers->push_back(kClientDataHeader); | ||
| 551 | } | ||
| 552 | |||
| 553 | std::unique_ptr<network::SimpleURLLoader> | ||
| 554 | @@ -359,14 +331,11 @@ CreateSimpleURLLoaderWithVariationsHeade | ||
| 555 | } | ||
| 556 | |||
| 557 | bool IsVariationsHeader(const std::string& header_name) { | ||
| 558 | - return header_name == kClientDataHeader || | ||
| 559 | - header_name == kOmniboxOnDeviceSuggestionsHeader; | ||
| 560 | + return false; | ||
| 561 | } | ||
| 562 | |||
| 563 | bool HasVariationsHeader(const network::ResourceRequest& request) { | ||
| 564 | - // Note: kOmniboxOnDeviceSuggestionsHeader is not listed because this function | ||
| 565 | - // is only used for testing. | ||
| 566 | - return request.cors_exempt_headers.HasHeader(kClientDataHeader); | ||
| 567 | + return false; | ||
| 568 | } | ||
| 569 | |||
| 570 | bool ShouldAppendVariationsHeaderForTesting( | ||
| 571 | @@ -377,12 +346,6 @@ bool ShouldAppendVariationsHeaderForTest | ||
| 572 | |||
| 573 | void UpdateCorsExemptHeaderForVariations( | ||
| 574 | network::mojom::NetworkContextParams* params) { | ||
| 575 | - params->cors_exempt_header_list.push_back(kClientDataHeader); | ||
| 576 | - | ||
| 577 | - if (base::FeatureList::IsEnabled(kReportOmniboxOnDeviceSuggestionsHeader)) { | ||
| 578 | - params->cors_exempt_header_list.push_back( | ||
| 579 | - kOmniboxOnDeviceSuggestionsHeader); | ||
| 580 | - } | ||
| 581 | } | ||
| 582 | |||
| 583 | } // namespace variations | ||
| 584 | --- net/base/url_util.cc.orig | ||
| 585 | +++ net/base/url_util.cc | ||
| 586 | @@ -442,27 +442,6 @@ bool HasGoogleHost(const GURL& url) { | ||
| 587 | } | ||
| 588 | |||
| 589 | bool IsGoogleHost(base::StringPiece host) { | ||
| 590 | - static const char* kGoogleHostSuffixes[] = { | ||
| 591 | - ".google.com", | ||
| 592 | - ".youtube.com", | ||
| 593 | - ".gmail.com", | ||
| 594 | - ".doubleclick.net", | ||
| 595 | - ".gstatic.com", | ||
| 596 | - ".googlevideo.com", | ||
| 597 | - ".googleusercontent.com", | ||
| 598 | - ".googlesyndication.com", | ||
| 599 | - ".google-analytics.com", | ||
| 600 | - ".googleadservices.com", | ||
| 601 | - ".googleapis.com", | ||
| 602 | - ".ytimg.com", | ||
| 603 | - }; | ||
| 604 | - for (const char* suffix : kGoogleHostSuffixes) { | ||
| 605 | - // Here it's possible to get away with faster case-sensitive comparisons | ||
| 606 | - // because the list above is all lowercase, and a GURL's host name will | ||
| 607 | - // always be canonicalized to lowercase as well. | ||
| 608 | - if (base::EndsWith(host, suffix)) | ||
| 609 | - return true; | ||
| 610 | - } | ||
| 611 | return false; | ||
| 612 | } | ||
| 613 | |||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/disable-mei-preload.patch b/www/chromium-uc/patches/core/ungoogled-chromium/disable-mei-preload.patch new file mode 100644 index 0000000..731e85d --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/disable-mei-preload.patch | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | # Disables use of a binary for preloading the Media Engagement index | ||
| 2 | # Said binary is: chrome/browser/resources/media/mei_preload/preloaded_data.pb | ||
| 3 | # According to media/base/media_switches (for PreloadMediaEngagementData), it | ||
| 4 | # "enables a list of origins to be considered as having a high MEI until there | ||
| 5 | # is enough local data to determine the user's preferred behavior." This feature | ||
| 6 | # does not seem to outweigh the benefit of removing the binary, thus this patch. | ||
| 7 | |||
| 8 | --- chrome/BUILD.gn.orig | ||
| 9 | +++ chrome/BUILD.gn | ||
| 10 | @@ -351,7 +351,6 @@ if (!is_android && !is_mac) { | ||
| 11 | } | ||
| 12 | |||
| 13 | data_deps += [ | ||
| 14 | - "//chrome/browser/resources/media/mei_preload:component", | ||
| 15 | "//third_party/widevine/cdm", | ||
| 16 | ] | ||
| 17 | } | ||
| 18 | @@ -1157,7 +1156,6 @@ if (is_win) { | ||
| 19 | ":keystone_registration_framework", | ||
| 20 | ":swiftshader_library", | ||
| 21 | ":widevine_cdm_library", | ||
| 22 | - "//chrome/browser/resources/media/mei_preload:component_bundle", | ||
| 23 | ] | ||
| 24 | |||
| 25 | if (is_chrome_branded) { | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/disable-network-time-tracker.patch b/www/chromium-uc/patches/core/ungoogled-chromium/disable-network-time-tracker.patch new file mode 100644 index 0000000..fb27026 --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/disable-network-time-tracker.patch | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | # Disable Network Time Tracker | ||
| 2 | # This connects to Google to check if the system time is correct when a website certificate | ||
| 3 | # date seems incorrect, according to https://bugs.chromium.org/p/chromium/issues/detail?id=725232, | ||
| 4 | # Fixes https://github.com/Eloston/ungoogled-chromium/issues/302 | ||
| 5 | |||
| 6 | --- components/network_time/network_time_tracker.cc.orig | ||
| 7 | +++ components/network_time/network_time_tracker.cc | ||
| 8 | @@ -277,7 +277,7 @@ void NetworkTimeTracker::UpdateNetworkTi | ||
| 9 | } | ||
| 10 | |||
| 11 | bool NetworkTimeTracker::AreTimeFetchesEnabled() const { | ||
| 12 | - return base::FeatureList::IsEnabled(kNetworkTimeServiceQuerying); | ||
| 13 | + return false; | ||
| 14 | } | ||
| 15 | |||
| 16 | NetworkTimeTracker::FetchBehavior NetworkTimeTracker::GetFetchBehavior() const { | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/disable-privacy-sandbox.patch b/www/chromium-uc/patches/core/ungoogled-chromium/disable-privacy-sandbox.patch new file mode 100644 index 0000000..a4e7e8b --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/disable-privacy-sandbox.patch | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | --- chrome/browser/privacy_sandbox/privacy_sandbox_settings.cc.orig | ||
| 2 | +++ chrome/browser/privacy_sandbox/privacy_sandbox_settings.cc | ||
| 3 | @@ -378,7 +378,7 @@ std::vector<GURL> PrivacySandboxSettings | ||
| 4 | } | ||
| 5 | |||
| 6 | bool PrivacySandboxSettings::IsPrivacySandboxAllowed() { | ||
| 7 | - return pref_service_->GetBoolean(prefs::kPrivacySandboxApisEnabled); | ||
| 8 | + return false; | ||
| 9 | } | ||
| 10 | |||
| 11 | bool PrivacySandboxSettings::IsPrivacySandboxEnabled() { | ||
| 12 | @@ -390,8 +390,6 @@ bool PrivacySandboxSettings::IsPrivacySa | ||
| 13 | } | ||
| 14 | |||
| 15 | void PrivacySandboxSettings::SetPrivacySandboxEnabled(bool enabled) { | ||
| 16 | - pref_service_->SetBoolean(prefs::kPrivacySandboxManuallyControlled, true); | ||
| 17 | - pref_service_->SetBoolean(prefs::kPrivacySandboxApisEnabled, enabled); | ||
| 18 | } | ||
| 19 | |||
| 20 | void PrivacySandboxSettings::OnCookiesCleared() { | ||
| 21 | --- chrome/browser/resources/settings/privacy_page/privacy_page.html.orig | ||
| 22 | +++ chrome/browser/resources/settings/privacy_page/privacy_page.html | ||
| 23 | @@ -64,19 +64,6 @@ | ||
| 24 | sub-label="$i18n{permissionsPageDescription}" | ||
| 25 | on-click="onPermissionsPageClick_" | ||
| 26 | role-description="$i18n{subpageArrowRoleDescription}"></cr-link-row> | ||
| 27 | - <cr-link-row id="privacySandboxLinkRow" | ||
| 28 | - start-icon="settings20:experiment" | ||
| 29 | - class="hr" | ||
| 30 | - label="$i18n{privacySandboxTitle}" | ||
| 31 | - sub-label="[[computePrivacySandboxSublabel_( | ||
| 32 | - prefs.privacy_sandbox.apis_enabled.*)]]" | ||
| 33 | - on-click="onPrivacySandboxClick_" | ||
| 34 | - external | ||
| 35 | - role-description="$i18n{subpageArrowRoleDescription}"> | ||
| 36 | - </cr-link-row> | ||
| 37 | - <a id="privacySandboxLink" href="privacySandbox" | ||
| 38 | - target="_blank" tabindex="-1" aria-disabled="true" | ||
| 39 | - role="none"></a> | ||
| 40 | </div> | ||
| 41 | |||
| 42 | <if expr="use_nss_certs"> | ||
| 43 | --- components/privacy_sandbox/privacy_sandbox_prefs.cc.orig | ||
| 44 | +++ components/privacy_sandbox/privacy_sandbox_prefs.cc | ||
| 45 | @@ -31,7 +31,7 @@ namespace privacy_sandbox { | ||
| 46 | |||
| 47 | void RegisterProfilePrefs(PrefRegistrySimple* registry) { | ||
| 48 | registry->RegisterBooleanPref( | ||
| 49 | - prefs::kPrivacySandboxApisEnabled, true, | ||
| 50 | + prefs::kPrivacySandboxApisEnabled, false, | ||
| 51 | user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | ||
| 52 | registry->RegisterBooleanPref( | ||
| 53 | prefs::kPrivacySandboxManuallyControlled, false, | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/disable-profile-avatar-downloading.patch b/www/chromium-uc/patches/core/ungoogled-chromium/disable-profile-avatar-downloading.patch new file mode 100644 index 0000000..dee938a --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/disable-profile-avatar-downloading.patch | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | # Stop downloading of profile avatar (trk:271:...) | ||
| 2 | |||
| 3 | --- chrome/browser/profiles/profile_avatar_downloader.cc.orig | ||
| 4 | +++ chrome/browser/profiles/profile_avatar_downloader.cc | ||
| 5 | @@ -27,8 +27,7 @@ ProfileAvatarDownloader::ProfileAvatarDo | ||
| 6 | FetchCompleteCallback callback) | ||
| 7 | : icon_index_(icon_index), callback_(std::move(callback)) { | ||
| 8 | DCHECK(!callback_.is_null()); | ||
| 9 | - GURL url(std::string(kHighResAvatarDownloadUrlPrefix) + | ||
| 10 | - profiles::GetDefaultAvatarIconFileNameAtIndex(icon_index)); | ||
| 11 | + GURL url(std::string("about:blank")); | ||
| 12 | net::NetworkTrafficAnnotationTag traffic_annotation = | ||
| 13 | net::DefineNetworkTrafficAnnotation("profile_avatar", R"( | ||
| 14 | semantics { | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/disable-signin.patch b/www/chromium-uc/patches/core/ungoogled-chromium/disable-signin.patch new file mode 100644 index 0000000..b2b6081 --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/disable-signin.patch | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | # Disables browser sign-in | ||
| 2 | |||
| 3 | --- chrome/browser/ui/chrome_pages.cc.orig | ||
| 4 | +++ chrome/browser/ui/chrome_pages.cc | ||
| 5 | @@ -480,32 +480,6 @@ GURL GetOSSettingsUrl(const std::string& | ||
| 6 | void ShowBrowserSignin(Browser* browser, | ||
| 7 | signin_metrics::AccessPoint access_point, | ||
| 8 | signin::ConsentLevel consent_level) { | ||
| 9 | - Profile* original_profile = browser->profile()->GetOriginalProfile(); | ||
| 10 | - DCHECK(original_profile->GetPrefs()->GetBoolean(prefs::kSigninAllowed)); | ||
| 11 | - | ||
| 12 | - // If the browser's profile is an incognito profile, make sure to use | ||
| 13 | - // a browser window from the original profile. The user cannot sign in | ||
| 14 | - // from an incognito window. | ||
| 15 | - auto displayer = | ||
| 16 | - std::make_unique<ScopedTabbedBrowserDisplayer>(original_profile); | ||
| 17 | - browser = displayer->browser(); | ||
| 18 | - | ||
| 19 | - profiles::BubbleViewMode bubble_view_mode; | ||
| 20 | - if (IdentityManagerFactory::GetForProfile(original_profile) | ||
| 21 | - ->HasPrimaryAccount(signin::ConsentLevel::kSync)) { | ||
| 22 | - bubble_view_mode = profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH; | ||
| 23 | - } else { | ||
| 24 | - switch (consent_level) { | ||
| 25 | - case signin::ConsentLevel::kSync: | ||
| 26 | - bubble_view_mode = profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN; | ||
| 27 | - break; | ||
| 28 | - case signin::ConsentLevel::kSignin: | ||
| 29 | - bubble_view_mode = profiles::BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT; | ||
| 30 | - break; | ||
| 31 | - } | ||
| 32 | - } | ||
| 33 | - | ||
| 34 | - browser->signin_view_controller()->ShowSignin(bubble_view_mode, access_point); | ||
| 35 | } | ||
| 36 | |||
| 37 | void ShowBrowserSigninOrSettings(Browser* browser, | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/disable-untraceable-urls.patch b/www/chromium-uc/patches/core/ungoogled-chromium/disable-untraceable-urls.patch new file mode 100644 index 0000000..612ec7d --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/disable-untraceable-urls.patch | |||
| @@ -0,0 +1,92 @@ | |||
| 1 | # Disable additional URLs that are not caught by the "trk" scheme | ||
| 2 | |||
| 3 | --- chrome/browser/plugins/plugins_resource_service.cc.orig | ||
| 4 | +++ chrome/browser/plugins/plugins_resource_service.cc | ||
| 5 | @@ -53,9 +53,6 @@ const int kStartResourceFetchDelayMs = 6 | ||
| 6 | // Delay between calls to update the cache 1 day and 2 minutes in testing mode. | ||
| 7 | const int kCacheUpdateDelayMs = 24 * 60 * 60 * 1000; | ||
| 8 | |||
| 9 | -const char kPluginsServerUrl[] = | ||
| 10 | - "https://www.gstatic.com/chrome/config/plugins_3/"; | ||
| 11 | - | ||
| 12 | GURL GetPluginsServerURL() { | ||
| 13 | std::string filename; | ||
| 14 | #if defined(OS_WIN) | ||
| 15 | @@ -70,7 +67,7 @@ GURL GetPluginsServerURL() { | ||
| 16 | #error Unknown platform | ||
| 17 | #endif | ||
| 18 | |||
| 19 | - return GURL(kPluginsServerUrl + filename); | ||
| 20 | + return GURL("about:blank"); | ||
| 21 | } | ||
| 22 | |||
| 23 | } // namespace | ||
| 24 | --- components/safe_browsing/content/browser/client_side_model_loader.cc.orig | ||
| 25 | +++ components/safe_browsing/content/browser/client_side_model_loader.cc | ||
| 26 | @@ -61,8 +61,6 @@ std::string ReadFileIntoString(base::Fil | ||
| 27 | // Model Loader strings | ||
| 28 | const size_t ModelLoader::kMaxModelSizeBytes = 150 * 1024; | ||
| 29 | const int ModelLoader::kClientModelFetchIntervalMs = 3600 * 1000; | ||
| 30 | -const char ModelLoader::kClientModelUrlPrefix[] = | ||
| 31 | - "https://ssl.gstatic.com/safebrowsing/csd/"; | ||
| 32 | const char ModelLoader::kClientModelNamePattern[] = | ||
| 33 | "client_model_v5%s_variation_%d.pb"; | ||
| 34 | #if !BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 35 | @@ -123,7 +121,7 @@ ModelLoader::ModelLoader( | ||
| 36 | scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, | ||
| 37 | bool is_extended_reporting) | ||
| 38 | : name_(FillInModelName(is_extended_reporting, GetModelNumber())), | ||
| 39 | - url_(kClientModelUrlPrefix + name_), | ||
| 40 | + url_("about:blank"), | ||
| 41 | update_renderers_callback_(update_renderers_callback), | ||
| 42 | url_loader_factory_(url_loader_factory), | ||
| 43 | last_client_model_status_(ClientModelStatus::MODEL_NEVER_FETCHED) { | ||
| 44 | @@ -136,7 +134,7 @@ ModelLoader::ModelLoader( | ||
| 45 | scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, | ||
| 46 | const std::string& model_name) | ||
| 47 | : name_(model_name), | ||
| 48 | - url_(kClientModelUrlPrefix + name_), | ||
| 49 | + url_("about:blank"), | ||
| 50 | update_renderers_callback_(update_renderers_callback), | ||
| 51 | url_loader_factory_(url_loader_factory), | ||
| 52 | last_client_model_status_(ClientModelStatus::MODEL_NEVER_FETCHED) { | ||
| 53 | --- rlz/lib/financial_ping.cc.orig | ||
| 54 | +++ rlz/lib/financial_ping.cc | ||
| 55 | @@ -338,7 +338,7 @@ FinancialPing::PingResponse FinancialPin | ||
| 56 | |||
| 57 | // Open network connection. | ||
| 58 | InternetHandle connection_handle = InternetConnectA(inet_handle, | ||
| 59 | - kFinancialServer, kFinancialPort, "", "", INTERNET_SERVICE_HTTP, | ||
| 60 | + "about:blank", kFinancialPort, "", "", INTERNET_SERVICE_HTTP, | ||
| 61 | INTERNET_FLAG_NO_CACHE_WRITE, 0); | ||
| 62 | if (!connection_handle) | ||
| 63 | return PING_FAILURE; | ||
| 64 | @@ -382,7 +382,7 @@ FinancialPing::PingResponse FinancialPin | ||
| 65 | return PING_SUCCESSFUL; | ||
| 66 | #else | ||
| 67 | std::string url = | ||
| 68 | - base::StringPrintf("https://%s%s", kFinancialServer, request); | ||
| 69 | + base::StringPrintf("https://%s%s", "about:blank", request); | ||
| 70 | |||
| 71 | // Use a waitable event to cause this function to block, to match the | ||
| 72 | // wininet implementation. | ||
| 73 | --- rlz/lib/lib_values.cc.orig | ||
| 74 | +++ rlz/lib/lib_values.cc | ||
| 75 | @@ -40,7 +40,6 @@ const char kSetDccResponseVariable[] = " | ||
| 76 | // | ||
| 77 | |||
| 78 | const char kFinancialPingPath[] = "/tools/pso/ping"; | ||
| 79 | -const char kFinancialServer[] = "trk:443:clients1.google.com"; /* not using URLRequest! catch with cache.ir */ | ||
| 80 | const int kFinancialPort = 443; | ||
| 81 | |||
| 82 | // Ping times in 100-nanosecond intervals. | ||
| 83 | --- rlz/lib/lib_values.h.orig | ||
| 84 | +++ rlz/lib/lib_values.h | ||
| 85 | @@ -72,7 +72,6 @@ extern const char kSetDccResponseVariabl | ||
| 86 | // | ||
| 87 | |||
| 88 | extern const char kFinancialPingPath[]; | ||
| 89 | -extern const char kFinancialServer[]; | ||
| 90 | |||
| 91 | extern const int kFinancialPort; | ||
| 92 | |||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/disable-webrtc-log-uploader.patch b/www/chromium-uc/patches/core/ungoogled-chromium/disable-webrtc-log-uploader.patch new file mode 100644 index 0000000..9416c17 --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/disable-webrtc-log-uploader.patch | |||
| @@ -0,0 +1,114 @@ | |||
| 1 | # Disables WebRTC log uploading to Google | ||
| 2 | |||
| 3 | --- chrome/browser/media/webrtc/webrtc_log_uploader.cc.orig | ||
| 4 | +++ chrome/browser/media/webrtc/webrtc_log_uploader.cc | ||
| 5 | @@ -127,28 +127,11 @@ void WebRtcLogUploader::LoggingStoppedDo | ||
| 6 | DCHECK(meta_data.get()); | ||
| 7 | DCHECK(!upload_done_data.paths.directory.empty()); | ||
| 8 | |||
| 9 | - std::string compressed_log = CompressLog(log_buffer.get()); | ||
| 10 | - | ||
| 11 | - std::string local_log_id; | ||
| 12 | - | ||
| 13 | if (base::PathExists(upload_done_data.paths.directory)) { | ||
| 14 | webrtc_logging::DeleteOldWebRtcLogFiles(upload_done_data.paths.directory); | ||
| 15 | - | ||
| 16 | - local_log_id = base::NumberToString(base::Time::Now().ToDoubleT()); | ||
| 17 | - base::FilePath log_file_path = | ||
| 18 | - upload_done_data.paths.directory.AppendASCII(local_log_id) | ||
| 19 | - .AddExtension(FILE_PATH_LITERAL(".gz")); | ||
| 20 | - WriteCompressedLogToFile(compressed_log, log_file_path); | ||
| 21 | - | ||
| 22 | - base::FilePath log_list_path = | ||
| 23 | - webrtc_logging::TextLogList::GetWebRtcLogListFileForDirectory( | ||
| 24 | - upload_done_data.paths.directory); | ||
| 25 | - AddLocallyStoredLogInfoToUploadListFile(log_list_path, local_log_id); | ||
| 26 | } | ||
| 27 | |||
| 28 | - upload_done_data.local_log_id = local_log_id; | ||
| 29 | - PrepareMultipartPostData(compressed_log, std::move(meta_data), | ||
| 30 | - std::move(upload_done_data)); | ||
| 31 | + NotifyUploadDoneAndLogStats(net::HTTP_OK, net::OK, "", std::move(upload_done_data)); | ||
| 32 | } | ||
| 33 | |||
| 34 | void WebRtcLogUploader::PrepareMultipartPostData( | ||
| 35 | @@ -159,28 +142,7 @@ void WebRtcLogUploader::PrepareMultipart | ||
| 36 | DCHECK(!compressed_log.empty()); | ||
| 37 | DCHECK(meta_data.get()); | ||
| 38 | |||
| 39 | - std::unique_ptr<std::string> post_data(new std::string()); | ||
| 40 | - SetupMultipart(post_data.get(), compressed_log, | ||
| 41 | - upload_done_data.paths.incoming_rtp_dump, | ||
| 42 | - upload_done_data.paths.outgoing_rtp_dump, *meta_data.get()); | ||
| 43 | - | ||
| 44 | - // If a test has set the test string pointer, write to it and skip uploading. | ||
| 45 | - // Still fire the upload callback so that we can run an extension API test | ||
| 46 | - // using the test framework for that without hanging. | ||
| 47 | - // TODO(grunell): Remove this when the api test for this feature is fully | ||
| 48 | - // implemented according to the test plan. http://crbug.com/257329. | ||
| 49 | - if (post_data_) { | ||
| 50 | - *post_data_ = *post_data; | ||
| 51 | - NotifyUploadDoneAndLogStats(net::HTTP_OK, net::OK, "", | ||
| 52 | - std::move(upload_done_data)); | ||
| 53 | - return; | ||
| 54 | - } | ||
| 55 | - | ||
| 56 | - main_task_runner_->PostTask( | ||
| 57 | - FROM_HERE, | ||
| 58 | - base::BindOnce(&WebRtcLogUploader::UploadCompressedLog, | ||
| 59 | - base::Unretained(this), std::move(upload_done_data), | ||
| 60 | - std::move(post_data))); | ||
| 61 | + NotifyUploadDoneAndLogStats(net::HTTP_OK, net::OK, "", std::move(upload_done_data)); | ||
| 62 | } | ||
| 63 | |||
| 64 | void WebRtcLogUploader::UploadStoredLog( | ||
| 65 | @@ -246,49 +208,6 @@ void WebRtcLogUploader::LoggingStoppedDo | ||
| 66 | DCHECK(log_buffer.get()); | ||
| 67 | DCHECK(!log_paths.directory.empty()); | ||
| 68 | |||
| 69 | - webrtc_logging::DeleteOldWebRtcLogFiles(log_paths.directory); | ||
| 70 | - | ||
| 71 | - base::FilePath log_list_path = | ||
| 72 | - webrtc_logging::TextLogList::GetWebRtcLogListFileForDirectory( | ||
| 73 | - log_paths.directory); | ||
| 74 | - | ||
| 75 | - // Store the native log with a ".gz" extension. | ||
| 76 | - std::string compressed_log = CompressLog(log_buffer.get()); | ||
| 77 | - base::FilePath native_log_path = | ||
| 78 | - log_paths.directory.AppendASCII(log_id).AddExtension( | ||
| 79 | - FILE_PATH_LITERAL(".gz")); | ||
| 80 | - WriteCompressedLogToFile(compressed_log, native_log_path); | ||
| 81 | - AddLocallyStoredLogInfoToUploadListFile(log_list_path, log_id); | ||
| 82 | - | ||
| 83 | - // Move the rtp dump files to the log directory with a name of | ||
| 84 | - // <log id>.rtp_[in|out]. | ||
| 85 | - if (!log_paths.incoming_rtp_dump.empty()) { | ||
| 86 | - base::FilePath rtp_path = | ||
| 87 | - log_paths.directory.AppendASCII(log_id).AddExtension( | ||
| 88 | - FILE_PATH_LITERAL(".rtp_in")); | ||
| 89 | - base::Move(log_paths.incoming_rtp_dump, rtp_path); | ||
| 90 | - } | ||
| 91 | - | ||
| 92 | - if (!log_paths.outgoing_rtp_dump.empty()) { | ||
| 93 | - base::FilePath rtp_path = | ||
| 94 | - log_paths.directory.AppendASCII(log_id).AddExtension( | ||
| 95 | - FILE_PATH_LITERAL(".rtp_out")); | ||
| 96 | - base::Move(log_paths.outgoing_rtp_dump, rtp_path); | ||
| 97 | - } | ||
| 98 | - | ||
| 99 | - if (meta_data.get() && !meta_data->empty()) { | ||
| 100 | - base::Pickle pickle; | ||
| 101 | - for (const auto& it : *meta_data.get()) { | ||
| 102 | - pickle.WriteString(it.first); | ||
| 103 | - pickle.WriteString(it.second); | ||
| 104 | - } | ||
| 105 | - base::FilePath meta_path = | ||
| 106 | - log_paths.directory.AppendASCII(log_id).AddExtension( | ||
| 107 | - FILE_PATH_LITERAL(".meta")); | ||
| 108 | - base::WriteFile(meta_path, static_cast<const char*>(pickle.data()), | ||
| 109 | - pickle.size()); | ||
| 110 | - } | ||
| 111 | - | ||
| 112 | main_task_runner_->PostTask( | ||
| 113 | FROM_HERE, base::BindOnce(std::move(done_callback), true, "")); | ||
| 114 | |||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/disable-webstore-urls.patch b/www/chromium-uc/patches/core/ungoogled-chromium/disable-webstore-urls.patch new file mode 100644 index 0000000..8259c4d --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/disable-webstore-urls.patch | |||
| @@ -0,0 +1,182 @@ | |||
| 1 | # Disables Chrome Webstore-related URLs and other internal functionality. Mainly for disabling auto updates via the Chrome Webstore. | ||
| 2 | |||
| 3 | --- chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc.orig | ||
| 4 | +++ chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc | ||
| 5 | @@ -655,10 +655,6 @@ std::vector<url::Origin> ChromeContentBr | ||
| 6 | GetOriginsRequiringDedicatedProcess() { | ||
| 7 | std::vector<url::Origin> list; | ||
| 8 | |||
| 9 | - // Require a dedicated process for the webstore origin. See | ||
| 10 | - // https://crbug.com/939108. | ||
| 11 | - list.push_back(url::Origin::Create(extension_urls::GetWebstoreLaunchURL())); | ||
| 12 | - | ||
| 13 | return list; | ||
| 14 | } | ||
| 15 | |||
| 16 | --- chrome/browser/extensions/chrome_content_verifier_delegate.cc.orig | ||
| 17 | +++ chrome/browser/extensions/chrome_content_verifier_delegate.cc | ||
| 18 | @@ -288,17 +288,7 @@ bool ChromeContentVerifierDelegate::IsFr | ||
| 19 | // between which extensions are considered in-store. | ||
| 20 | // See https://crbug.com/766806 for details. | ||
| 21 | if (!InstallVerifier::IsFromStore(extension, context_)) { | ||
| 22 | - // It's possible that the webstore update url was overridden for testing | ||
| 23 | - // so also consider extensions with the default (production) update url | ||
| 24 | - // to be from the store as well. Therefore update URL is compared with | ||
| 25 | - // |GetDefaultWebstoreUpdateUrl|, not the |GetWebstoreUpdateUrl| used by | ||
| 26 | - // |IsWebstoreUpdateUrl|. | ||
| 27 | - ExtensionManagement* extension_management = | ||
| 28 | - ExtensionManagementFactory::GetForBrowserContext(context_); | ||
| 29 | - if (extension_management->GetEffectiveUpdateURL(extension) != | ||
| 30 | - extension_urls::GetDefaultWebstoreUpdateUrl()) { | ||
| 31 | - return false; | ||
| 32 | - } | ||
| 33 | + return false; | ||
| 34 | } | ||
| 35 | return true; | ||
| 36 | } | ||
| 37 | --- chrome/browser/extensions/extension_migrator.cc.orig | ||
| 38 | +++ chrome/browser/extensions/extension_migrator.cc | ||
| 39 | @@ -18,7 +18,9 @@ namespace extensions { | ||
| 40 | ExtensionMigrator::ExtensionMigrator(Profile* profile, | ||
| 41 | const std::string& old_id, | ||
| 42 | const std::string& new_id) | ||
| 43 | - : profile_(profile), old_id_(old_id), new_id_(new_id) {} | ||
| 44 | + : profile_(profile), old_id_(old_id), new_id_(new_id) { | ||
| 45 | + chrome_blank_ = GURL("chrome://blank/"); | ||
| 46 | +} | ||
| 47 | |||
| 48 | ExtensionMigrator::~ExtensionMigrator() { | ||
| 49 | } | ||
| 50 | @@ -31,7 +33,7 @@ void ExtensionMigrator::StartLoading() { | ||
| 51 | if (should_have_extension) { | ||
| 52 | std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue); | ||
| 53 | entry->SetKey(ExternalProviderImpl::kExternalUpdateUrl, | ||
| 54 | - base::Value(extension_urls::GetWebstoreUpdateUrl().spec())); | ||
| 55 | + base::Value(chrome_blank_.spec())); | ||
| 56 | |||
| 57 | prefs->SetKey(new_id_, base::Value::FromUniquePtrValue(std::move(entry))); | ||
| 58 | } | ||
| 59 | --- chrome/browser/extensions/extension_migrator.h.orig | ||
| 60 | +++ chrome/browser/extensions/extension_migrator.h | ||
| 61 | @@ -9,6 +9,7 @@ | ||
| 62 | |||
| 63 | #include "base/macros.h" | ||
| 64 | #include "chrome/browser/extensions/external_loader.h" | ||
| 65 | +#include "url/gurl.h" | ||
| 66 | |||
| 67 | class Profile; | ||
| 68 | |||
| 69 | @@ -40,6 +41,7 @@ class ExtensionMigrator : public Externa | ||
| 70 | Profile* profile_; | ||
| 71 | const std::string old_id_; | ||
| 72 | const std::string new_id_; | ||
| 73 | + GURL chrome_blank_; | ||
| 74 | }; | ||
| 75 | |||
| 76 | } // namespace extensions | ||
| 77 | --- extensions/browser/updater/extension_downloader.cc.orig | ||
| 78 | +++ extensions/browser/updater/extension_downloader.cc | ||
| 79 | @@ -93,27 +93,18 @@ const char kNotFromWebstoreInstallSource | ||
| 80 | const char kDefaultInstallSource[] = ""; | ||
| 81 | const char kReinstallInstallSource[] = "reinstall"; | ||
| 82 | |||
| 83 | -const char kGoogleDotCom[] = "google.com"; | ||
| 84 | const char kTokenServiceConsumerId[] = "extension_downloader"; | ||
| 85 | const char kWebstoreOAuth2Scope[] = | ||
| 86 | - "https://www.googleapis.com/auth/chromewebstore.readonly"; | ||
| 87 | + "trk:10:https://www.googleapis.com/auth/chromewebstore.readonly"; | ||
| 88 | |||
| 89 | ExtensionDownloaderTestDelegate* g_test_delegate = nullptr; | ||
| 90 | |||
| 91 | #define RETRY_HISTOGRAM(name, retry_count, url) \ | ||
| 92 | - if ((url).DomainIs(kGoogleDotCom)) { \ | ||
| 93 | - UMA_HISTOGRAM_CUSTOM_COUNTS("Extensions." name "RetryCountGoogleUrl", \ | ||
| 94 | - retry_count, \ | ||
| 95 | - 1, \ | ||
| 96 | - kMaxRetries, \ | ||
| 97 | - kMaxRetries + 1); \ | ||
| 98 | - } else { \ | ||
| 99 | UMA_HISTOGRAM_CUSTOM_COUNTS("Extensions." name "RetryCountOtherUrl", \ | ||
| 100 | retry_count, \ | ||
| 101 | 1, \ | ||
| 102 | kMaxRetries, \ | ||
| 103 | - kMaxRetries + 1); \ | ||
| 104 | - } | ||
| 105 | + kMaxRetries + 1); | ||
| 106 | |||
| 107 | bool ShouldRetryRequest(const network::SimpleURLLoader* loader) { | ||
| 108 | DCHECK(loader); | ||
| 109 | @@ -309,12 +300,6 @@ void ExtensionDownloader::DoStartAllPend | ||
| 110 | ReportStats(); | ||
| 111 | url_stats_ = URLStats(); | ||
| 112 | |||
| 113 | - for (auto it = fetches_preparing_.begin(); it != fetches_preparing_.end(); | ||
| 114 | - ++it) { | ||
| 115 | - std::vector<std::unique_ptr<ManifestFetchData>>& list = it->second; | ||
| 116 | - for (size_t i = 0; i < list.size(); ++i) | ||
| 117 | - StartUpdateCheck(std::move(list[i])); | ||
| 118 | - } | ||
| 119 | fetches_preparing_.clear(); | ||
| 120 | } | ||
| 121 | |||
| 122 | @@ -353,11 +338,6 @@ bool ExtensionDownloader::AddExtensionDa | ||
| 123 | return false; | ||
| 124 | } | ||
| 125 | |||
| 126 | - // Make sure we use SSL for store-hosted extensions. | ||
| 127 | - if (extension_urls::IsWebstoreUpdateUrl(update_url) && | ||
| 128 | - !update_url.SchemeIsCryptographic()) | ||
| 129 | - update_url = extension_urls::GetWebstoreUpdateUrl(); | ||
| 130 | - | ||
| 131 | // Skip extensions with empty IDs. | ||
| 132 | if (id.empty()) { | ||
| 133 | DLOG(WARNING) << "Found extension with empty ID"; | ||
| 134 | @@ -366,12 +346,10 @@ bool ExtensionDownloader::AddExtensionDa | ||
| 135 | return false; | ||
| 136 | } | ||
| 137 | |||
| 138 | - if (update_url.DomainIs(kGoogleDotCom)) { | ||
| 139 | - url_stats_.google_url_count++; | ||
| 140 | - } else if (update_url.is_empty()) { | ||
| 141 | + if (update_url.is_empty()) { | ||
| 142 | url_stats_.no_url_count++; | ||
| 143 | // Fill in default update URL. | ||
| 144 | - update_url = extension_urls::GetWebstoreUpdateUrl(); | ||
| 145 | + update_url = GURL("chrome://blank/"); | ||
| 146 | } else { | ||
| 147 | url_stats_.other_url_count++; | ||
| 148 | } | ||
| 149 | @@ -845,20 +823,6 @@ void ExtensionDownloader::HandleManifest | ||
| 150 | update->info); | ||
| 151 | } | ||
| 152 | |||
| 153 | - // If the manifest response included a <daystart> element, we want to save | ||
| 154 | - // that value for any extensions which had sent a ping in the request. | ||
| 155 | - if (fetch_data->base_url().DomainIs(kGoogleDotCom) && | ||
| 156 | - results->daystart_elapsed_seconds >= 0) { | ||
| 157 | - Time day_start = | ||
| 158 | - Time::Now() - base::Seconds(results->daystart_elapsed_seconds); | ||
| 159 | - | ||
| 160 | - for (const ExtensionId& id : extension_ids) { | ||
| 161 | - ExtensionDownloaderDelegate::PingResult& result = ping_results_[id]; | ||
| 162 | - result.did_ping = fetch_data->DidPing(id, ManifestFetchData::ROLLCALL); | ||
| 163 | - result.day_start = day_start; | ||
| 164 | - } | ||
| 165 | - } | ||
| 166 | - | ||
| 167 | NotifyExtensionsDownloadStageChanged( | ||
| 168 | no_updates, ExtensionDownloaderDelegate::Stage::FINISHED); | ||
| 169 | NotifyExtensionsDownloadFailed( | ||
| 170 | @@ -1417,11 +1381,7 @@ bool ExtensionDownloader::IterateFetchCr | ||
| 171 | // fetch. | ||
| 172 | switch (fetch->credentials) { | ||
| 173 | case ExtensionFetch::CREDENTIALS_NONE: | ||
| 174 | - if (fetch->url.DomainIs(kGoogleDotCom) && identity_manager_) { | ||
| 175 | - fetch->credentials = ExtensionFetch::CREDENTIALS_OAUTH2_TOKEN; | ||
| 176 | - } else { | ||
| 177 | - fetch->credentials = ExtensionFetch::CREDENTIALS_COOKIES; | ||
| 178 | - } | ||
| 179 | + fetch->credentials = ExtensionFetch::CREDENTIALS_COOKIES; | ||
| 180 | return true; | ||
| 181 | case ExtensionFetch::CREDENTIALS_OAUTH2_TOKEN: | ||
| 182 | fetch->oauth2_attempt_count++; | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/doh-changes.patch b/www/chromium-uc/patches/core/ungoogled-chromium/doh-changes.patch new file mode 100644 index 0000000..4ee53be --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/doh-changes.patch | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | --- chrome/common/chrome_features.cc.orig | ||
| 2 | +++ chrome/common/chrome_features.cc | ||
| 3 | @@ -323,12 +323,7 @@ const base::Feature kDesktopPWAsWebBundl | ||
| 4 | // Enable DNS over HTTPS (DoH). | ||
| 5 | const base::Feature kDnsOverHttps { | ||
| 6 | "DnsOverHttps", | ||
| 7 | -#if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_MAC) || \ | ||
| 8 | - defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_BSD) | ||
| 9 | - base::FEATURE_ENABLED_BY_DEFAULT | ||
| 10 | -#else | ||
| 11 | base::FEATURE_DISABLED_BY_DEFAULT | ||
| 12 | -#endif | ||
| 13 | }; | ||
| 14 | |||
| 15 | // Provides a mechanism to remove providers from the dropdown list in the | ||
| 16 | --- net/dns/public/doh_provider_entry.cc.orig | ||
| 17 | +++ net/dns/public/doh_provider_entry.cc | ||
| 18 | @@ -117,24 +117,6 @@ const DohProviderEntry::List& DohProvide | ||
| 19 | /*privacy_policy=*/"https://dns.sb/privacy/", | ||
| 20 | /*display_globally=*/false, /*display_countries=*/{"EE", "DE"}, | ||
| 21 | LoggingLevel::kNormal), | ||
| 22 | - new DohProviderEntry("Google", DohProviderIdForHistogram::kGoogle, | ||
| 23 | - {"8.8.8.8", "8.8.4.4", "2001:4860:4860::8888", | ||
| 24 | - "2001:4860:4860::8844"}, | ||
| 25 | - {"dns.google", "dns.google.com", | ||
| 26 | - "8888.google"} /* dns_over_tls_hostnames */, | ||
| 27 | - "https://dns.google/dns-query{?dns}", | ||
| 28 | - "Google (Public DNS)" /* ui_name */, | ||
| 29 | - "https://developers.google.com/speed/public-dns/" | ||
| 30 | - "privacy" /* privacy_policy */, | ||
| 31 | - true /* display_globally */, | ||
| 32 | - {} /* display_countries */, LoggingLevel::kExtra), | ||
| 33 | - new DohProviderEntry( | ||
| 34 | - "GoogleDns64", absl::nullopt /* provider_id_for_histogram */, | ||
| 35 | - {"2001:4860:4860::64", "2001:4860:4860::6464"}, | ||
| 36 | - {"dns64.dns.google"} /* dns_over_tls_hostnames */, | ||
| 37 | - "https://dns64.dns.google/dns-query{?dns}", "" /* ui_name */, | ||
| 38 | - "" /* privacy_policy */, false /* display_globally */, | ||
| 39 | - {} /* display_countries */, LoggingLevel::kNormal), | ||
| 40 | new DohProviderEntry("Iij", DohProviderIdForHistogram::kIij, | ||
| 41 | {} /* ip_strs */, {} /* dns_over_tls_hostnames */, | ||
| 42 | "https://public.dns.iij.jp/dns-query", | ||
| 43 | --- services/network/public/cpp/features.cc.orig | ||
| 44 | +++ services/network/public/cpp/features.cc | ||
| 45 | @@ -114,12 +114,7 @@ const base::Feature kSplitAuthCacheByNet | ||
| 46 | // Enable usage of hardcoded DoH upgrade mapping for use in automatic mode. | ||
| 47 | const base::Feature kDnsOverHttpsUpgrade { | ||
| 48 | "DnsOverHttpsUpgrade", | ||
| 49 | -#if BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_MAC) || defined(OS_ANDROID) || \ | ||
| 50 | - defined(OS_WIN) | ||
| 51 | - base::FEATURE_ENABLED_BY_DEFAULT | ||
| 52 | -#else | ||
| 53 | base::FEATURE_DISABLED_BY_DEFAULT | ||
| 54 | -#endif | ||
| 55 | }; | ||
| 56 | |||
| 57 | // If this feature is enabled, the mDNS responder service responds to queries | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/fix-building-with-prunned-binaries.patch b/www/chromium-uc/patches/core/ungoogled-chromium/fix-building-with-prunned-binaries.patch new file mode 100644 index 0000000..16b7351 --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/fix-building-with-prunned-binaries.patch | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | # Contains tests and features that are unneeded and would otherwise | ||
| 2 | # require binaries to be whitelisted in the pruning list | ||
| 3 | |||
| 4 | --- chrome/test/chromedriver/BUILD.gn.orig | ||
| 5 | +++ chrome/test/chromedriver/BUILD.gn | ||
| 6 | @@ -311,11 +311,7 @@ source_set("lib") { | ||
| 7 | } | ||
| 8 | } | ||
| 9 | |||
| 10 | -if (is_linux) { | ||
| 11 | - chromedriver_output = "chromedriver.unstripped" | ||
| 12 | -} else { | ||
| 13 | chromedriver_output = "chromedriver" | ||
| 14 | -} | ||
| 15 | |||
| 16 | executable("$chromedriver_output") { | ||
| 17 | testonly = true | ||
| 18 | @@ -337,16 +333,6 @@ executable("$chromedriver_output") { | ||
| 19 | } | ||
| 20 | } | ||
| 21 | |||
| 22 | -if (is_linux) { | ||
| 23 | - strip_binary("chromedriver") { | ||
| 24 | - testonly = true | ||
| 25 | - binary_input = "$root_out_dir/$chromedriver_output" | ||
| 26 | - symbol_output = "$root_out_dir/chromedriver.debug" | ||
| 27 | - stripped_binary_output = "$root_out_dir/chromedriver" | ||
| 28 | - deps = [ ":$chromedriver_output" ] | ||
| 29 | - } | ||
| 30 | -} | ||
| 31 | - | ||
| 32 | python_library("chromedriver_py_tests") { | ||
| 33 | testonly = true | ||
| 34 | deps = [ | ||
| 35 | --- third_party/devtools-frontend/src/BUILD.gn.orig | ||
| 36 | +++ third_party/devtools-frontend/src/BUILD.gn | ||
| 37 | @@ -136,7 +136,6 @@ foreach(module_file, non_autostart_non_r | ||
| 38 | devtools_frontend_resources_deps = [ | ||
| 39 | ":build_release_devtools", | ||
| 40 | "front_end", | ||
| 41 | - "test", | ||
| 42 | ] | ||
| 43 | |||
| 44 | group("devtools_all_files") { | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/fix-building-without-enabling-reporting.patch b/www/chromium-uc/patches/core/ungoogled-chromium/fix-building-without-enabling-reporting.patch new file mode 100644 index 0000000..f86694a --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/fix-building-without-enabling-reporting.patch | |||
| @@ -0,0 +1,215 @@ | |||
| 1 | --- content/browser/BUILD.gn.orig | ||
| 2 | +++ content/browser/BUILD.gn | ||
| 3 | @@ -1274,6 +1274,10 @@ source_set("browser") { | ||
| 4 | "net/browser_online_state_observer.cc", | ||
| 5 | "net/browser_online_state_observer.h", | ||
| 6 | "net/cookie_store_factory.cc", | ||
| 7 | + "net/cross_origin_embedder_policy_reporter.cc", | ||
| 8 | + "net/cross_origin_embedder_policy_reporter.h", | ||
| 9 | + "net/cross_origin_opener_policy_reporter.cc", | ||
| 10 | + "net/cross_origin_opener_policy_reporter.h", | ||
| 11 | "net/network_errors_listing_ui.cc", | ||
| 12 | "net/network_errors_listing_ui.h", | ||
| 13 | "net/network_quality_observer_impl.cc", | ||
| 14 | @@ -3034,10 +3038,6 @@ source_set("browser") { | ||
| 15 | |||
| 16 | if (enable_reporting) { | ||
| 17 | sources += [ | ||
| 18 | - "net/cross_origin_embedder_policy_reporter.cc", | ||
| 19 | - "net/cross_origin_embedder_policy_reporter.h", | ||
| 20 | - "net/cross_origin_opener_policy_reporter.cc", | ||
| 21 | - "net/cross_origin_opener_policy_reporter.h", | ||
| 22 | "net/reporting_service_proxy.cc", | ||
| 23 | "net/reporting_service_proxy.h", | ||
| 24 | ] | ||
| 25 | --- content/browser/devtools/protocol/network_handler.h.orig | ||
| 26 | +++ content/browser/devtools/protocol/network_handler.h | ||
| 27 | @@ -309,8 +309,10 @@ class NetworkHandler : public DevToolsDo | ||
| 28 | Response response, | ||
| 29 | mojo::ScopedDataPipeConsumerHandle pipe, | ||
| 30 | const std::string& mime_type); | ||
| 31 | +#if BUILDFLAG(ENABLE_REPORTING) | ||
| 32 | std::unique_ptr<protocol::Network::ReportingApiReport> BuildProtocolReport( | ||
| 33 | const net::ReportingReport& report); | ||
| 34 | +#endif | ||
| 35 | |||
| 36 | // TODO(dgozman): Remove this. | ||
| 37 | const std::string host_id_; | ||
| 38 | --- content/public/common/content_switch_dependent_feature_overrides.cc.orig | ||
| 39 | +++ content/public/common/content_switch_dependent_feature_overrides.cc | ||
| 40 | @@ -40,9 +40,11 @@ GetSwitchDependentFeatureOverrides(const | ||
| 41 | {switches::kEnableExperimentalWebPlatformFeatures, | ||
| 42 | std::cref(features::kDocumentPolicyNegotiation), | ||
| 43 | base::FeatureList::OVERRIDE_ENABLE_FEATURE}, | ||
| 44 | +#if BUILDFLAG(ENABLE_REPORTING) | ||
| 45 | {switches::kEnableExperimentalWebPlatformFeatures, | ||
| 46 | std::cref(net::features::kDocumentReporting), | ||
| 47 | base::FeatureList::OVERRIDE_ENABLE_FEATURE}, | ||
| 48 | +#endif | ||
| 49 | {switches::kEnableExperimentalWebPlatformFeatures, | ||
| 50 | std::cref(features::kExperimentalContentSecurityPolicyFeatures), | ||
| 51 | base::FeatureList::OVERRIDE_ENABLE_FEATURE}, | ||
| 52 | --- services/network/network_context.cc.orig | ||
| 53 | +++ services/network/network_context.cc | ||
| 54 | @@ -1140,6 +1140,11 @@ void NetworkContext::QueueSignedExchange | ||
| 55 | const net::NetworkIsolationKey& network_isolation_key) { | ||
| 56 | NOTREACHED(); | ||
| 57 | } | ||
| 58 | + | ||
| 59 | +void NetworkContext::AddReportingApiObserver( | ||
| 60 | + mojo::PendingRemote<network::mojom::ReportingApiObserver> observer) { | ||
| 61 | + NOTREACHED(); | ||
| 62 | +} | ||
| 63 | #endif // BUILDFLAG(ENABLE_REPORTING) | ||
| 64 | |||
| 65 | void NetworkContext::ClearDomainReliability( | ||
| 66 | --- services/network/network_context.h.orig | ||
| 67 | +++ services/network/network_context.h | ||
| 68 | @@ -570,10 +570,10 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) | ||
| 69 | return require_network_isolation_key_; | ||
| 70 | } | ||
| 71 | |||
| 72 | -#if BUILDFLAG(ENABLE_REPORTING) | ||
| 73 | void AddReportingApiObserver( | ||
| 74 | mojo::PendingRemote<network::mojom::ReportingApiObserver> observer) | ||
| 75 | override; | ||
| 76 | +#if BUILDFLAG(ENABLE_REPORTING) | ||
| 77 | void OnReportAdded(const net::ReportingReport* service_report) override; | ||
| 78 | void OnReportUpdated(const net::ReportingReport* service_report) override; | ||
| 79 | void OnReportingObserverDisconnect(mojo::RemoteSetElementId mojo_id); | ||
| 80 | --- third_party/blink/renderer/core/frame/local_frame.cc.orig | ||
| 81 | +++ third_party/blink/renderer/core/frame/local_frame.cc | ||
| 82 | @@ -39,6 +39,7 @@ | ||
| 83 | #include "base/values.h" | ||
| 84 | #include "mojo/public/cpp/bindings/self_owned_receiver.h" | ||
| 85 | #include "mojo/public/cpp/system/message_pipe.h" | ||
| 86 | +#include "net/net_buildflags.h" | ||
| 87 | #include "services/data_decoder/public/mojom/resource_snapshot_for_web_bundle.mojom-blink.h" | ||
| 88 | #include "services/network/public/cpp/features.h" | ||
| 89 | #include "services/network/public/mojom/content_security_policy.mojom-blink.h" | ||
| 90 | @@ -2304,9 +2305,11 @@ const base::UnguessableToken& LocalFrame | ||
| 91 | return base::UnguessableToken::Null(); | ||
| 92 | } | ||
| 93 | |||
| 94 | +#if BUILDFLAG(ENABLE_REPORTING) | ||
| 95 | mojom::blink::ReportingServiceProxy* LocalFrame::GetReportingService() { | ||
| 96 | return mojo_handler_->ReportingService(); | ||
| 97 | } | ||
| 98 | +#endif | ||
| 99 | |||
| 100 | // static | ||
| 101 | void LocalFrame::NotifyUserActivation( | ||
| 102 | --- third_party/blink/renderer/core/frame/local_frame.h.orig | ||
| 103 | +++ third_party/blink/renderer/core/frame/local_frame.h | ||
| 104 | @@ -37,6 +37,7 @@ | ||
| 105 | #include "build/build_config.h" | ||
| 106 | #include "mojo/public/cpp/bindings/pending_associated_receiver.h" | ||
| 107 | #include "mojo/public/cpp/bindings/pending_receiver.h" | ||
| 108 | +#include "net/net_buildflags.h" | ||
| 109 | #include "services/device/public/mojom/device_posture_provider.mojom-blink-forward.h" | ||
| 110 | #include "services/network/public/mojom/fetch_api.mojom-blink-forward.h" | ||
| 111 | #include "third_party/blink/public/common/frame/frame_ad_evidence.h" | ||
| 112 | @@ -546,7 +547,9 @@ class CORE_EXPORT LocalFrame final : pub | ||
| 113 | |||
| 114 | SmoothScrollSequencer& GetSmoothScrollSequencer(); | ||
| 115 | |||
| 116 | +#if BUILDFLAG(ENABLE_REPORTING) | ||
| 117 | mojom::blink::ReportingServiceProxy* GetReportingService(); | ||
| 118 | +#endif | ||
| 119 | |||
| 120 | // Returns the frame host ptr. The interface returned is backed by an | ||
| 121 | // associated interface with the legacy Chrome IPC channel. | ||
| 122 | --- third_party/blink/renderer/core/frame/reporting_context.cc.orig | ||
| 123 | +++ third_party/blink/renderer/core/frame/reporting_context.cc | ||
| 124 | @@ -4,6 +4,7 @@ | ||
| 125 | |||
| 126 | #include "third_party/blink/renderer/core/frame/reporting_context.h" | ||
| 127 | |||
| 128 | +#include "net/net_buildflags.h" | ||
| 129 | #include "third_party/blink/public/common/browser_interface_broker_proxy.h" | ||
| 130 | #include "third_party/blink/public/platform/platform.h" | ||
| 131 | #include "third_party/blink/public/platform/task_type.h" | ||
| 132 | @@ -54,7 +55,9 @@ const char ReportingContext::kSupplement | ||
| 133 | ReportingContext::ReportingContext(ExecutionContext& context) | ||
| 134 | : Supplement<ExecutionContext>(context), | ||
| 135 | execution_context_(context), | ||
| 136 | +#if BUILDFLAG(ENABLE_REPORTING) | ||
| 137 | reporting_service_(&context), | ||
| 138 | +#endif | ||
| 139 | receiver_(this, &context) {} | ||
| 140 | |||
| 141 | // static | ||
| 142 | @@ -118,7 +121,9 @@ void ReportingContext::Trace(Visitor* vi | ||
| 143 | visitor->Trace(observers_); | ||
| 144 | visitor->Trace(report_buffer_); | ||
| 145 | visitor->Trace(execution_context_); | ||
| 146 | +#if BUILDFLAG(ENABLE_REPORTING) | ||
| 147 | visitor->Trace(reporting_service_); | ||
| 148 | +#endif | ||
| 149 | visitor->Trace(receiver_); | ||
| 150 | Supplement<ExecutionContext>::Trace(visitor); | ||
| 151 | } | ||
| 152 | @@ -140,6 +145,7 @@ void ReportingContext::CountReport(Repor | ||
| 153 | UseCounter::Count(execution_context_, feature); | ||
| 154 | } | ||
| 155 | |||
| 156 | +#if BUILDFLAG(ENABLE_REPORTING) | ||
| 157 | const HeapMojoRemote<mojom::blink::ReportingServiceProxy>& | ||
| 158 | ReportingContext::GetReportingService() const { | ||
| 159 | if (!reporting_service_.is_bound()) { | ||
| 160 | @@ -149,6 +155,7 @@ ReportingContext::GetReportingService() | ||
| 161 | } | ||
| 162 | return reporting_service_; | ||
| 163 | } | ||
| 164 | +#endif | ||
| 165 | |||
| 166 | void ReportingContext::NotifyInternal(Report* report) { | ||
| 167 | // Buffer the report. | ||
| 168 | @@ -171,6 +178,7 @@ void ReportingContext::NotifyInternal(Re | ||
| 169 | |||
| 170 | void ReportingContext::SendToReportingAPI(Report* report, | ||
| 171 | const String& endpoint) const { | ||
| 172 | +#if BUILDFLAG(ENABLE_REPORTING) | ||
| 173 | const String& type = report->type(); | ||
| 174 | if (!(type == ReportType::kCSPViolation || type == ReportType::kDeprecation || | ||
| 175 | type == ReportType::kPermissionsPolicyViolation || | ||
| 176 | @@ -226,6 +234,7 @@ void ReportingContext::SendToReportingAP | ||
| 177 | url, endpoint, body->featureId(), body->disposition(), body->message(), | ||
| 178 | body->sourceFile(), line_number, column_number); | ||
| 179 | } | ||
| 180 | +#endif | ||
| 181 | } | ||
| 182 | |||
| 183 | } // namespace blink | ||
| 184 | --- third_party/blink/renderer/core/frame/reporting_context.h.orig | ||
| 185 | +++ third_party/blink/renderer/core/frame/reporting_context.h | ||
| 186 | @@ -5,6 +5,7 @@ | ||
| 187 | #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_REPORTING_CONTEXT_H_ | ||
| 188 | #define THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_REPORTING_CONTEXT_H_ | ||
| 189 | |||
| 190 | +#include "net/net_buildflags.h" | ||
| 191 | #include "third_party/blink/public/mojom/frame/reporting_observer.mojom-blink.h" | ||
| 192 | #include "third_party/blink/public/mojom/reporting/reporting.mojom-blink.h" | ||
| 193 | #include "third_party/blink/renderer/core/core_export.h" | ||
| 194 | @@ -54,8 +55,10 @@ class CORE_EXPORT ReportingContext : pub | ||
| 195 | // Counts the use of a report type via UseCounter. | ||
| 196 | void CountReport(Report*); | ||
| 197 | |||
| 198 | +#if BUILDFLAG(ENABLE_REPORTING) | ||
| 199 | const HeapMojoRemote<mojom::blink::ReportingServiceProxy>& | ||
| 200 | GetReportingService() const; | ||
| 201 | +#endif | ||
| 202 | |||
| 203 | void NotifyInternal(Report* report); | ||
| 204 | // Send |report| via the Reporting API to |endpoint|. | ||
| 205 | @@ -67,8 +70,10 @@ class CORE_EXPORT ReportingContext : pub | ||
| 206 | |||
| 207 | // This is declared mutable so that the service endpoint can be cached by | ||
| 208 | // const methods. | ||
| 209 | +#if BUILDFLAG(ENABLE_REPORTING) | ||
| 210 | mutable HeapMojoRemote<mojom::blink::ReportingServiceProxy> | ||
| 211 | reporting_service_; | ||
| 212 | +#endif | ||
| 213 | |||
| 214 | HeapMojoReceiver<mojom::blink::ReportingObserver, ReportingContext> receiver_; | ||
| 215 | }; | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/fix-building-without-one-click-signin.patch b/www/chromium-uc/patches/core/ungoogled-chromium/fix-building-without-one-click-signin.patch new file mode 100644 index 0000000..17b383f --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/fix-building-without-one-click-signin.patch | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | # Fix building without one click signin | ||
| 2 | |||
| 3 | --- chrome/browser/ui/sync/one_click_signin_links_delegate_impl.cc.orig | ||
| 4 | +++ chrome/browser/ui/sync/one_click_signin_links_delegate_impl.cc | ||
| 5 | @@ -16,9 +16,4 @@ OneClickSigninLinksDelegateImpl::OneClic | ||
| 6 | OneClickSigninLinksDelegateImpl::~OneClickSigninLinksDelegateImpl() {} | ||
| 7 | |||
| 8 | void OneClickSigninLinksDelegateImpl::OnLearnMoreLinkClicked(bool is_dialog) { | ||
| 9 | - NavigateParams params(browser_, GURL(chrome::kChromeSyncLearnMoreURL), | ||
| 10 | - ui::PAGE_TRANSITION_LINK); | ||
| 11 | - params.disposition = is_dialog ? WindowOpenDisposition::NEW_WINDOW | ||
| 12 | - : WindowOpenDisposition::NEW_FOREGROUND_TAB; | ||
| 13 | - Navigate(¶ms); | ||
| 14 | } | ||
| 15 | --- chrome/browser/ui/webui/signin/inline_login_handler_impl.cc.orig | ||
| 16 | +++ chrome/browser/ui/webui/signin/inline_login_handler_impl.cc | ||
| 17 | @@ -360,6 +360,7 @@ void InlineSigninHelper::OnClientOAuthSu | ||
| 18 | const ClientOAuthResult& result, | ||
| 19 | Profile* /*profile*/, | ||
| 20 | Profile::CreateStatus /*status*/) { | ||
| 21 | +#if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) | ||
| 22 | HandlerSigninReason reason = GetHandlerSigninReason(current_url_); | ||
| 23 | if (reason == HandlerSigninReason::kFetchLstOnly) { | ||
| 24 | // Constants are only available on Windows for the Google Credential | ||
| 25 | @@ -436,6 +437,7 @@ void InlineSigninHelper::OnClientOAuthSu | ||
| 26 | } | ||
| 27 | |||
| 28 | base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); | ||
| 29 | +#endif | ||
| 30 | } | ||
| 31 | |||
| 32 | void InlineSigninHelper::UntrustedSigninConfirmed( | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/fix-building-without-safebrowsing.patch b/www/chromium-uc/patches/core/ungoogled-chromium/fix-building-without-safebrowsing.patch new file mode 100644 index 0000000..d71a532 --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/fix-building-without-safebrowsing.patch | |||
| @@ -0,0 +1,1921 @@ | |||
| 1 | # Additional changes to Inox's fix-building-without-safebrowsing.patch | ||
| 2 | |||
| 3 | --- chrome/browser/BUILD.gn.orig | ||
| 4 | +++ chrome/browser/BUILD.gn | ||
| 5 | @@ -1953,7 +1953,6 @@ static_library("browser") { | ||
| 6 | "//chrome/browser/net:probe_message_proto", | ||
| 7 | "//chrome/browser/new_tab_page/modules/drive:mojo_bindings", | ||
| 8 | "//chrome/browser/new_tab_page/modules/photos:mojo_bindings", | ||
| 9 | - "//chrome/browser/new_tab_page/modules/safe_browsing:mojo_bindings", | ||
| 10 | "//chrome/browser/new_tab_page/modules/task_module:mojo_bindings", | ||
| 11 | "//chrome/browser/notifications", | ||
| 12 | "//chrome/browser/notifications/scheduler:factory", | ||
| 13 | @@ -3726,9 +3725,6 @@ static_library("browser") { | ||
| 14 | "download/offline_item_model_manager_factory.h", | ||
| 15 | "enterprise/connectors/analysis/analysis_service_settings.cc", | ||
| 16 | "enterprise/connectors/analysis/analysis_service_settings.h", | ||
| 17 | - "enterprise/connectors/analysis/content_analysis_delegate.cc", | ||
| 18 | - "enterprise/connectors/analysis/content_analysis_delegate.h", | ||
| 19 | - "enterprise/connectors/analysis/content_analysis_delegate_base.h", | ||
| 20 | "enterprise/connectors/analysis/content_analysis_dialog.cc", | ||
| 21 | "enterprise/connectors/analysis/content_analysis_dialog.h", | ||
| 22 | "enterprise/connectors/analysis/content_analysis_downloads_delegate.cc", | ||
| 23 | @@ -3978,10 +3974,6 @@ static_library("browser") { | ||
| 24 | "new_tab_page/modules/photos/photos_service.h", | ||
| 25 | "new_tab_page/modules/photos/photos_service_factory.cc", | ||
| 26 | "new_tab_page/modules/photos/photos_service_factory.h", | ||
| 27 | - "new_tab_page/modules/safe_browsing/safe_browsing_handler.cc", | ||
| 28 | - "new_tab_page/modules/safe_browsing/safe_browsing_handler.h", | ||
| 29 | - "new_tab_page/modules/safe_browsing/safe_browsing_prefs.cc", | ||
| 30 | - "new_tab_page/modules/safe_browsing/safe_browsing_prefs.h", | ||
| 31 | "new_tab_page/modules/task_module/task_module_handler.cc", | ||
| 32 | "new_tab_page/modules/task_module/task_module_handler.h", | ||
| 33 | "new_tab_page/modules/task_module/task_module_service.cc", | ||
| 34 | @@ -7012,9 +7004,14 @@ static_library("browser") { | ||
| 35 | "//components/safe_browsing/content/browser:safe_browsing_blocking_page", | ||
| 36 | "//components/safe_browsing/content/browser/download:download_stats", | ||
| 37 | "//components/safe_browsing/content/common:file_type_policies", | ||
| 38 | - "//components/safe_browsing/content/common/proto:download_file_types_proto", | ||
| 39 | + # "//components/safe_browsing/content/common/proto:download_file_types_proto", | ||
| 40 | ] | ||
| 41 | } | ||
| 42 | + # Use download_file_types_proto regardless of safe_browsing_mode, for | ||
| 43 | + # now... | ||
| 44 | + deps += [ | ||
| 45 | + "//components/safe_browsing/content/common/proto:download_file_types_proto", | ||
| 46 | + ] | ||
| 47 | |||
| 48 | if (!is_fuchsia) { | ||
| 49 | sources += [ | ||
| 50 | --- chrome/browser/accuracy_tips/accuracy_service_factory.cc.orig | ||
| 51 | +++ chrome/browser/accuracy_tips/accuracy_service_factory.cc | ||
| 52 | @@ -48,10 +48,7 @@ KeyedService* AccuracyServiceFactory::Bu | ||
| 53 | content::BrowserContext* browser_context) const { | ||
| 54 | DCHECK(base::FeatureList::IsEnabled(safe_browsing::kAccuracyTipsFeature)); | ||
| 55 | Profile* profile = Profile::FromBrowserContext(browser_context); | ||
| 56 | - auto sb_database = | ||
| 57 | - g_browser_process->safe_browsing_service() | ||
| 58 | - ? g_browser_process->safe_browsing_service()->database_manager() | ||
| 59 | - : nullptr; | ||
| 60 | + auto sb_database = nullptr; | ||
| 61 | auto* history_service = HistoryServiceFactory::GetForProfile( | ||
| 62 | profile, ServiceAccessType::IMPLICIT_ACCESS); | ||
| 63 | auto delegate = std::make_unique<AccuracyServiceDelegate>(profile); | ||
| 64 | --- chrome/browser/chrome_content_browser_client.cc.orig | ||
| 65 | +++ chrome/browser/chrome_content_browser_client.cc | ||
| 66 | @@ -4229,11 +4229,13 @@ ChromeContentBrowserClient::CreateThrott | ||
| 67 | &throttles); | ||
| 68 | #endif | ||
| 69 | |||
| 70 | +#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 71 | if (base::FeatureList::IsEnabled(safe_browsing::kDelayedWarnings)) { | ||
| 72 | throttles.push_back( | ||
| 73 | std::make_unique<safe_browsing::DelayedWarningNavigationThrottle>( | ||
| 74 | handle)); | ||
| 75 | } | ||
| 76 | +#endif | ||
| 77 | |||
| 78 | // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch | ||
| 79 | // of lacros-chrome is complete. | ||
| 80 | @@ -5632,26 +5634,7 @@ ChromeContentBrowserClient::GetSafeBrows | ||
| 81 | const std::vector<std::string>& allowlist_domains) { | ||
| 82 | DCHECK_CURRENTLY_ON(BrowserThread::IO); | ||
| 83 | |||
| 84 | - // Should not bypass safe browsing check if the check is for enterprise | ||
| 85 | - // lookup. | ||
| 86 | - if (!safe_browsing_enabled_for_profile && !should_check_on_sb_disabled) | ||
| 87 | - return nullptr; | ||
| 88 | - | ||
| 89 | - // |safe_browsing_service_| may be unavailable in tests. | ||
| 90 | - if (safe_browsing_service_ && !safe_browsing_url_checker_delegate_) { | ||
| 91 | - safe_browsing_url_checker_delegate_ = | ||
| 92 | - base::MakeRefCounted<safe_browsing::UrlCheckerDelegateImpl>( | ||
| 93 | - safe_browsing_service_->database_manager(), | ||
| 94 | - safe_browsing_service_->ui_manager()); | ||
| 95 | - } | ||
| 96 | - | ||
| 97 | - // Update allowlist domains. | ||
| 98 | - if (safe_browsing_url_checker_delegate_) { | ||
| 99 | - safe_browsing_url_checker_delegate_->SetPolicyAllowlistDomains( | ||
| 100 | - allowlist_domains); | ||
| 101 | - } | ||
| 102 | - | ||
| 103 | - return safe_browsing_url_checker_delegate_; | ||
| 104 | + return nullptr; | ||
| 105 | } | ||
| 106 | |||
| 107 | safe_browsing::RealTimeUrlLookupServiceBase* | ||
| 108 | @@ -5672,11 +5655,6 @@ ChromeContentBrowserClient::GetUrlLookup | ||
| 109 | GetForProfile(profile); | ||
| 110 | } | ||
| 111 | #endif | ||
| 112 | - | ||
| 113 | - if (is_consumer_lookup_enabled) { | ||
| 114 | - return safe_browsing::RealTimeUrlLookupServiceFactory::GetForProfile( | ||
| 115 | - profile); | ||
| 116 | - } | ||
| 117 | return nullptr; | ||
| 118 | } | ||
| 119 | |||
| 120 | --- chrome/browser/chrome_content_browser_client_receiver_bindings.cc.orig | ||
| 121 | +++ chrome/browser/chrome_content_browser_client_receiver_bindings.cc | ||
| 122 | @@ -139,45 +139,6 @@ void MaybeCreateSafeBrowsingForRenderer( | ||
| 123 | const std::vector<std::string>& allowlist_domains)> | ||
| 124 | get_checker_delegate, | ||
| 125 | mojo::PendingReceiver<safe_browsing::mojom::SafeBrowsing> receiver) { | ||
| 126 | - DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | ||
| 127 | - | ||
| 128 | - content::RenderProcessHost* render_process_host = | ||
| 129 | - content::RenderProcessHost::FromID(process_id); | ||
| 130 | - if (!render_process_host) | ||
| 131 | - return; | ||
| 132 | - | ||
| 133 | - PrefService* pref_service = | ||
| 134 | - Profile::FromBrowserContext(render_process_host->GetBrowserContext()) | ||
| 135 | - ->GetPrefs(); | ||
| 136 | - | ||
| 137 | - std::vector<std::string> allowlist_domains = | ||
| 138 | - safe_browsing::GetURLAllowlistByPolicy(pref_service); | ||
| 139 | - | ||
| 140 | - // Log the size of the domains to make sure copying them is | ||
| 141 | - // not too expensive. | ||
| 142 | - if (allowlist_domains.size() > 0) { | ||
| 143 | - int total_size = 0; | ||
| 144 | - for (const auto& domains : allowlist_domains) { | ||
| 145 | - total_size += domains.size(); | ||
| 146 | - } | ||
| 147 | - base::UmaHistogramCounts10000( | ||
| 148 | - "SafeBrowsing.Policy.AllowlistDomainsTotalSize", total_size); | ||
| 149 | - } | ||
| 150 | - | ||
| 151 | - bool safe_browsing_enabled = | ||
| 152 | - safe_browsing::IsSafeBrowsingEnabled(*pref_service); | ||
| 153 | - content::GetIOThreadTaskRunner({})->PostTask( | ||
| 154 | - FROM_HERE, | ||
| 155 | - base::BindOnce( | ||
| 156 | - &safe_browsing::MojoSafeBrowsingImpl::MaybeCreate, process_id, | ||
| 157 | - resource_context, | ||
| 158 | - base::BindRepeating(get_checker_delegate, safe_browsing_enabled, | ||
| 159 | - // Navigation initiated from renderer should never | ||
| 160 | - // check when safe browsing is disabled, because | ||
| 161 | - // enterprise check only supports mainframe URL. | ||
| 162 | - /*should_check_on_sb_disabled=*/false, | ||
| 163 | - allowlist_domains), | ||
| 164 | - std::move(receiver))); | ||
| 165 | } | ||
| 166 | |||
| 167 | // BadgeManager is not used for Android. | ||
| 168 | --- chrome/browser/component_updater/client_side_phishing_component_installer.cc.orig | ||
| 169 | +++ chrome/browser/component_updater/client_side_phishing_component_installer.cc | ||
| 170 | @@ -36,20 +36,6 @@ const char kClientSidePhishingManifestNa | ||
| 171 | |||
| 172 | void LoadFromDisk(const base::FilePath& pb_path, | ||
| 173 | const base::FilePath& visual_tflite_model_path) { | ||
| 174 | - if (pb_path.empty()) | ||
| 175 | - return; | ||
| 176 | - | ||
| 177 | - std::string binary_pb; | ||
| 178 | - if (!base::ReadFileToString(pb_path, &binary_pb)) | ||
| 179 | - binary_pb.clear(); | ||
| 180 | - | ||
| 181 | - base::File visual_tflite_model(visual_tflite_model_path, | ||
| 182 | - base::File::FLAG_OPEN | base::File::FLAG_READ); | ||
| 183 | - | ||
| 184 | - // The ClientSidePhishingModel singleton will react appropriately if the | ||
| 185 | - // |binary_pb| is empty or |visual_tflite_model| is invalid. | ||
| 186 | - safe_browsing::ClientSidePhishingModel::GetInstance() | ||
| 187 | - ->PopulateFromDynamicUpdate(binary_pb, std::move(visual_tflite_model)); | ||
| 188 | } | ||
| 189 | |||
| 190 | base::FilePath GetInstalledProtoPath(const base::FilePath& base) { | ||
| 191 | @@ -123,9 +109,6 @@ update_client::InstallerAttributes | ||
| 192 | ClientSidePhishingComponentInstallerPolicy::GetInstallerAttributes() const { | ||
| 193 | update_client::InstallerAttributes attributes; | ||
| 194 | |||
| 195 | - // Pass the tag parameter to the installer as the "tag" attribute; it will | ||
| 196 | - // be used to choose which binary is downloaded. | ||
| 197 | - attributes["tag"] = safe_browsing::GetClientSideDetectionTag(); | ||
| 198 | return attributes; | ||
| 199 | } | ||
| 200 | |||
| 201 | --- chrome/browser/download/chrome_download_manager_delegate.cc.orig | ||
| 202 | +++ chrome/browser/download/chrome_download_manager_delegate.cc | ||
| 203 | @@ -135,7 +135,6 @@ using content::DownloadManager; | ||
| 204 | using download::DownloadItem; | ||
| 205 | using download::DownloadPathReservationTracker; | ||
| 206 | using download::PathValidationResult; | ||
| 207 | -using safe_browsing::DownloadFileType; | ||
| 208 | using safe_browsing::DownloadProtectionService; | ||
| 209 | using ConnectionType = net::NetworkChangeNotifier::ConnectionType; | ||
| 210 | |||
| 211 | @@ -1517,8 +1516,6 @@ void ChromeDownloadManagerDelegate::OnDo | ||
| 212 | if (item->GetOriginalMimeType() == "application/x-x509-user-cert") | ||
| 213 | DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true); | ||
| 214 | #endif | ||
| 215 | - | ||
| 216 | - DownloadItemModel(item).SetDangerLevel(target_info->danger_level); | ||
| 217 | } | ||
| 218 | if (ShouldBlockFile(target_info->danger_type, item)) { | ||
| 219 | MaybeReportDangerousDownloadBlocked( | ||
| 220 | @@ -1670,7 +1667,6 @@ void ChromeDownloadManagerDelegate::Mayb | ||
| 221 | service->MaybeSendDangerousDownloadOpenedReport(download, | ||
| 222 | show_download_in_folder); | ||
| 223 | } | ||
| 224 | -#endif | ||
| 225 | if (!download->GetAutoOpened()) { | ||
| 226 | download::DownloadContent download_content = | ||
| 227 | download::DownloadContentFromMimeType(download->GetMimeType(), false); | ||
| 228 | @@ -1678,6 +1674,7 @@ void ChromeDownloadManagerDelegate::Mayb | ||
| 229 | download->GetDangerType(), download_content, base::Time::Now(), | ||
| 230 | download->GetEndTime(), show_download_in_folder); | ||
| 231 | } | ||
| 232 | +#endif | ||
| 233 | } | ||
| 234 | |||
| 235 | void ChromeDownloadManagerDelegate::CheckDownloadAllowed( | ||
| 236 | @@ -1754,30 +1751,6 @@ void ChromeDownloadManagerDelegate::Chec | ||
| 237 | std::move(callback).Run(true); | ||
| 238 | return; | ||
| 239 | } | ||
| 240 | - | ||
| 241 | - absl::optional<enterprise_connectors::AnalysisSettings> settings = | ||
| 242 | - safe_browsing::DeepScanningRequest::ShouldUploadBinary(download_item); | ||
| 243 | - | ||
| 244 | - if (settings.has_value()) { | ||
| 245 | - DownloadProtectionService* service = GetDownloadProtectionService(); | ||
| 246 | - // Save package never need malware scans, so exempt them from scanning if | ||
| 247 | - // there are no other tags. | ||
| 248 | - settings->tags.erase("malware"); | ||
| 249 | - if (!settings->tags.empty() && service) { | ||
| 250 | - download_item->SetUserData( | ||
| 251 | - enterprise_connectors::SavePackageScanningData::kKey, | ||
| 252 | - std::make_unique<enterprise_connectors::SavePackageScanningData>( | ||
| 253 | - std::move(callback))); | ||
| 254 | - | ||
| 255 | - service->UploadSavePackageForDeepScanning( | ||
| 256 | - download_item, std::move(save_package_files), | ||
| 257 | - base::BindRepeating( | ||
| 258 | - &ChromeDownloadManagerDelegate::CheckSavePackageScanningDone, | ||
| 259 | - weak_ptr_factory_.GetWeakPtr(), download_item->GetId()), | ||
| 260 | - std::move(settings.value())); | ||
| 261 | - return; | ||
| 262 | - } | ||
| 263 | - } | ||
| 264 | #endif | ||
| 265 | std::move(callback).Run(true); | ||
| 266 | } | ||
| 267 | --- chrome/browser/download/download_stats.cc.orig | ||
| 268 | +++ chrome/browser/download/download_stats.cc | ||
| 269 | @@ -8,6 +8,7 @@ | ||
| 270 | #include "base/metrics/user_metrics.h" | ||
| 271 | #include "base/notreached.h" | ||
| 272 | #include "components/profile_metrics/browser_profile_type.h" | ||
| 273 | +#include "components/safe_browsing/buildflags.h" | ||
| 274 | #include "components/safe_browsing/content/browser/download/download_stats.h" | ||
| 275 | |||
| 276 | void RecordDownloadCount(ChromeDownloadCountTypes type) { | ||
| 277 | @@ -27,8 +28,10 @@ void RecordDangerousDownloadWarningShown | ||
| 278 | bool has_user_gesture) { | ||
| 279 | base::UmaHistogramEnumeration("Download.ShowedDownloadWarning", danger_type, | ||
| 280 | download::DOWNLOAD_DANGER_TYPE_MAX); | ||
| 281 | +#if BUILDFLAG(SAFE_BROWSING_AVAILABLE) | ||
| 282 | safe_browsing::RecordDangerousDownloadWarningShown( | ||
| 283 | danger_type, file_path, is_https, has_user_gesture); | ||
| 284 | +#endif | ||
| 285 | } | ||
| 286 | |||
| 287 | void RecordOpenedDangerousConfirmDialog( | ||
| 288 | --- chrome/browser/download/download_target_determiner.cc.orig | ||
| 289 | +++ chrome/browser/download/download_target_determiner.cc | ||
| 290 | @@ -872,11 +872,13 @@ void DownloadTargetDeterminer::CheckVisi | ||
| 291 | bool visited_referrer_before) { | ||
| 292 | DCHECK_CURRENTLY_ON(BrowserThread::UI); | ||
| 293 | DCHECK_EQ(STATE_DETERMINE_INTERMEDIATE_PATH, next_state_); | ||
| 294 | +#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 295 | safe_browsing::RecordDownloadFileTypeAttributes( | ||
| 296 | safe_browsing::FileTypePolicies::GetInstance()->GetFileDangerLevel( | ||
| 297 | virtual_path_.BaseName()), | ||
| 298 | download_->HasUserGesture(), visited_referrer_before, | ||
| 299 | GetLastDownloadBypassTimestamp()); | ||
| 300 | +#endif // BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 301 | danger_level_ = GetDangerLevel( | ||
| 302 | visited_referrer_before ? VISITED_REFERRER : NO_VISITS_TO_REFERRER); | ||
| 303 | if (danger_level_ != DownloadFileType::NOT_DANGEROUS && | ||
| 304 | @@ -1111,6 +1113,7 @@ DownloadFileType::DangerLevel DownloadTa | ||
| 305 | |||
| 306 | absl::optional<base::Time> | ||
| 307 | DownloadTargetDeterminer::GetLastDownloadBypassTimestamp() const { | ||
| 308 | +#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 309 | safe_browsing::SafeBrowsingMetricsCollector* metrics_collector = | ||
| 310 | safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile( | ||
| 311 | GetProfile()); | ||
| 312 | @@ -1119,6 +1122,9 @@ DownloadTargetDeterminer::GetLastDownloa | ||
| 313 | safe_browsing::SafeBrowsingMetricsCollector:: | ||
| 314 | EventType::DANGEROUS_DOWNLOAD_BYPASS) | ||
| 315 | : absl::nullopt; | ||
| 316 | +#else | ||
| 317 | + return absl::nullopt; | ||
| 318 | +#endif // BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 319 | } | ||
| 320 | |||
| 321 | void DownloadTargetDeterminer::OnDownloadDestroyed( | ||
| 322 | --- chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc.orig | ||
| 323 | +++ chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc | ||
| 324 | @@ -32,7 +32,6 @@ | ||
| 325 | #include "chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service_factory.h" | ||
| 326 | #include "chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.h" | ||
| 327 | #include "chrome/browser/safe_browsing/cloud_content_scanning/file_analysis_request.h" | ||
| 328 | -#include "chrome/browser/safe_browsing/download_protection/check_client_download_request.h" | ||
| 329 | #include "chrome/grit/generated_resources.h" | ||
| 330 | #include "components/enterprise/common/proto/connectors.pb.h" | ||
| 331 | #include "components/policy/core/browser/url_util.h" | ||
| 332 | --- chrome/browser/enterprise/connectors/connectors_service.cc.orig | ||
| 333 | +++ chrome/browser/enterprise/connectors/connectors_service.cc | ||
| 334 | @@ -475,19 +475,6 @@ absl::optional<std::string> ConnectorsSe | ||
| 335 | return absl::nullopt; | ||
| 336 | } | ||
| 337 | |||
| 338 | -safe_browsing::EnterpriseRealTimeUrlCheckMode | ||
| 339 | -ConnectorsService::GetAppliedRealTimeUrlCheck() const { | ||
| 340 | - if (!ConnectorsEnabled() || | ||
| 341 | - !GetDmToken(prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckScope) | ||
| 342 | - .has_value()) { | ||
| 343 | - return safe_browsing::REAL_TIME_CHECK_DISABLED; | ||
| 344 | - } | ||
| 345 | - | ||
| 346 | - return static_cast<safe_browsing::EnterpriseRealTimeUrlCheckMode>( | ||
| 347 | - Profile::FromBrowserContext(context_)->GetPrefs()->GetInteger( | ||
| 348 | - prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckMode)); | ||
| 349 | -} | ||
| 350 | - | ||
| 351 | ConnectorsManager* ConnectorsService::ConnectorsManagerForTesting() { | ||
| 352 | return connectors_manager_.get(); | ||
| 353 | } | ||
| 354 | --- chrome/browser/enterprise/connectors/connectors_service.h.orig | ||
| 355 | +++ chrome/browser/enterprise/connectors/connectors_service.h | ||
| 356 | @@ -78,12 +78,6 @@ class ConnectorsService : public KeyedSe | ||
| 357 | // is no token to use. | ||
| 358 | absl::optional<std::string> GetDMTokenForRealTimeUrlCheck() const; | ||
| 359 | |||
| 360 | - // Returns the value to used by the enterprise real-time URL check Connector | ||
| 361 | - // if it is set and if the scope it's set at has a valid browser-profile | ||
| 362 | - // affiliation. | ||
| 363 | - safe_browsing::EnterpriseRealTimeUrlCheckMode GetAppliedRealTimeUrlCheck() | ||
| 364 | - const; | ||
| 365 | - | ||
| 366 | // Returns the CBCM domain or profile domain that enables connector policies. | ||
| 367 | // If both set Connector policies, the CBCM domain is returned as it has | ||
| 368 | // precedence. | ||
| 369 | --- chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator.cc.orig | ||
| 370 | +++ chrome/browser/enterprise/connectors/device_trust/signals/decorators/common/common_signals_decorator.cc | ||
| 371 | @@ -38,9 +38,6 @@ void CommonSignalsDecorator::Decorate(Si | ||
| 372 | // Get signals from policy values. | ||
| 373 | signals.set_built_in_dns_client_enabled( | ||
| 374 | enterprise_signals::utils::GetBuiltInDnsClientEnabled(local_state_)); | ||
| 375 | - signals.set_safe_browsing_protection_level(static_cast<int32_t>( | ||
| 376 | - enterprise_signals::utils::GetSafeBrowsingProtectionLevel( | ||
| 377 | - profile_prefs_))); | ||
| 378 | signals.set_remote_desktop_available( | ||
| 379 | enterprise_signals::utils::GetChromeRemoteDesktopAppBlocked( | ||
| 380 | policy_blocklist_service_)); | ||
| 381 | @@ -58,15 +55,6 @@ void CommonSignalsDecorator::Decorate(Si | ||
| 382 | signals.set_chrome_cleanup_enabled(chrome_cleanup_enabled.value()); | ||
| 383 | } | ||
| 384 | |||
| 385 | - absl::optional<safe_browsing::PasswordProtectionTrigger> | ||
| 386 | - password_protection_warning_trigger = | ||
| 387 | - enterprise_signals::utils::GetPasswordProtectionWarningTrigger( | ||
| 388 | - profile_prefs_); | ||
| 389 | - if (password_protection_warning_trigger.has_value()) { | ||
| 390 | - signals.set_password_protection_warning_trigger( | ||
| 391 | - static_cast<int32_t>(password_protection_warning_trigger.value())); | ||
| 392 | - } | ||
| 393 | - | ||
| 394 | std::move(done_closure).Run(); | ||
| 395 | } | ||
| 396 | |||
| 397 | --- chrome/browser/enterprise/signals/context_info_fetcher.cc.orig | ||
| 398 | +++ chrome/browser/enterprise/signals/context_info_fetcher.cc | ||
| 399 | @@ -169,7 +169,6 @@ void ContextInfoFetcher::Fetch(ContextIn | ||
| 400 | GetAnalysisConnectorProviders(enterprise_connectors::FILE_DOWNLOADED); | ||
| 401 | info.on_bulk_data_entry_providers = | ||
| 402 | GetAnalysisConnectorProviders(enterprise_connectors::BULK_DATA_ENTRY); | ||
| 403 | - info.realtime_url_check_mode = GetRealtimeUrlCheckMode(); | ||
| 404 | info.on_security_event_providers = GetOnSecurityEventProviders(); | ||
| 405 | info.browser_version = version_info::GetVersionNumber(); | ||
| 406 | info.site_isolation_enabled = | ||
| 407 | @@ -227,11 +226,6 @@ std::vector<std::string> ContextInfoFetc | ||
| 408 | return connectors_service_->GetAnalysisServiceProviderNames(connector); | ||
| 409 | } | ||
| 410 | |||
| 411 | -safe_browsing::EnterpriseRealTimeUrlCheckMode | ||
| 412 | -ContextInfoFetcher::GetRealtimeUrlCheckMode() { | ||
| 413 | - return connectors_service_->GetAppliedRealTimeUrlCheck(); | ||
| 414 | -} | ||
| 415 | - | ||
| 416 | std::vector<std::string> ContextInfoFetcher::GetOnSecurityEventProviders() { | ||
| 417 | return connectors_service_->GetReportingServiceProviderNames( | ||
| 418 | enterprise_connectors::ReportingConnector::SECURITY_EVENT); | ||
| 419 | --- chrome/browser/enterprise/signals/context_info_fetcher.h.orig | ||
| 420 | +++ chrome/browser/enterprise/signals/context_info_fetcher.h | ||
| 421 | @@ -6,6 +6,7 @@ | ||
| 422 | #define CHROME_BROWSER_ENTERPRISE_SIGNALS_CONTEXT_INFO_FETCHER_H_ | ||
| 423 | |||
| 424 | #include <string> | ||
| 425 | +#include <memory> | ||
| 426 | #include <vector> | ||
| 427 | |||
| 428 | #include "base/callback_forward.h" | ||
| 429 | @@ -37,7 +38,6 @@ struct ContextInfo { | ||
| 430 | std::vector<std::string> on_file_downloaded_providers; | ||
| 431 | std::vector<std::string> on_bulk_data_entry_providers; | ||
| 432 | std::vector<std::string> on_security_event_providers; | ||
| 433 | - safe_browsing::EnterpriseRealTimeUrlCheckMode realtime_url_check_mode; | ||
| 434 | std::string browser_version; | ||
| 435 | safe_browsing::SafeBrowsingState safe_browsing_protection_level; | ||
| 436 | bool site_isolation_enabled; | ||
| 437 | @@ -88,7 +88,6 @@ class ContextInfoFetcher { | ||
| 438 | std::vector<std::string> GetAnalysisConnectorProviders( | ||
| 439 | enterprise_connectors::AnalysisConnector connector); | ||
| 440 | |||
| 441 | - safe_browsing::EnterpriseRealTimeUrlCheckMode GetRealtimeUrlCheckMode(); | ||
| 442 | |||
| 443 | std::vector<std::string> GetOnSecurityEventProviders(); | ||
| 444 | |||
| 445 | --- chrome/browser/enterprise/signals/signals_utils.cc.orig | ||
| 446 | +++ chrome/browser/enterprise/signals/signals_utils.cc | ||
| 447 | @@ -33,24 +33,6 @@ bool IsURLBlocked(const GURL& url, Polic | ||
| 448 | |||
| 449 | } // namespace | ||
| 450 | |||
| 451 | -safe_browsing::SafeBrowsingState GetSafeBrowsingProtectionLevel( | ||
| 452 | - PrefService* profile_prefs) { | ||
| 453 | - DCHECK(profile_prefs); | ||
| 454 | - bool safe_browsing_enabled = | ||
| 455 | - profile_prefs->GetBoolean(prefs::kSafeBrowsingEnabled); | ||
| 456 | - bool safe_browsing_enhanced_enabled = | ||
| 457 | - profile_prefs->GetBoolean(prefs::kSafeBrowsingEnhanced); | ||
| 458 | - | ||
| 459 | - if (safe_browsing_enabled) { | ||
| 460 | - if (safe_browsing_enhanced_enabled) | ||
| 461 | - return safe_browsing::SafeBrowsingState::ENHANCED_PROTECTION; | ||
| 462 | - else | ||
| 463 | - return safe_browsing::SafeBrowsingState::STANDARD_PROTECTION; | ||
| 464 | - } else { | ||
| 465 | - return safe_browsing::SafeBrowsingState::NO_SAFE_BROWSING; | ||
| 466 | - } | ||
| 467 | -} | ||
| 468 | - | ||
| 469 | absl::optional<bool> GetThirdPartyBlockingEnabled(PrefService* local_state) { | ||
| 470 | DCHECK(local_state); | ||
| 471 | #if defined(OS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING) | ||
| 472 | @@ -65,15 +47,6 @@ bool GetBuiltInDnsClientEnabled(PrefServ | ||
| 473 | return local_state->GetBoolean(prefs::kBuiltInDnsClientEnabled); | ||
| 474 | } | ||
| 475 | |||
| 476 | -absl::optional<safe_browsing::PasswordProtectionTrigger> | ||
| 477 | -GetPasswordProtectionWarningTrigger(PrefService* profile_prefs) { | ||
| 478 | - DCHECK(profile_prefs); | ||
| 479 | - if (!profile_prefs->HasPrefPath(prefs::kPasswordProtectionWarningTrigger)) | ||
| 480 | - return absl::nullopt; | ||
| 481 | - return static_cast<safe_browsing::PasswordProtectionTrigger>( | ||
| 482 | - profile_prefs->GetInteger(prefs::kPasswordProtectionWarningTrigger)); | ||
| 483 | -} | ||
| 484 | - | ||
| 485 | absl::optional<bool> GetChromeCleanupEnabled(PrefService* local_state) { | ||
| 486 | DCHECK(local_state); | ||
| 487 | #if defined(OS_WIN) | ||
| 488 | --- chrome/browser/enterprise/signals/signals_utils.h.orig | ||
| 489 | +++ chrome/browser/enterprise/signals/signals_utils.h | ||
| 490 | @@ -21,12 +21,6 @@ bool GetBuiltInDnsClientEnabled(PrefServ | ||
| 491 | |||
| 492 | absl::optional<bool> GetChromeCleanupEnabled(PrefService* local_state); | ||
| 493 | |||
| 494 | -absl::optional<safe_browsing::PasswordProtectionTrigger> | ||
| 495 | -GetPasswordProtectionWarningTrigger(PrefService* profile_prefs); | ||
| 496 | - | ||
| 497 | -safe_browsing::SafeBrowsingState GetSafeBrowsingProtectionLevel( | ||
| 498 | - PrefService* profile_prefs); | ||
| 499 | - | ||
| 500 | bool GetChromeRemoteDesktopAppBlocked(PolicyBlocklistService* service); | ||
| 501 | |||
| 502 | } // namespace utils | ||
| 503 | --- chrome/browser/extensions/BUILD.gn.orig | ||
| 504 | +++ chrome/browser/extensions/BUILD.gn | ||
| 505 | @@ -650,8 +650,6 @@ static_library("extensions") { | ||
| 506 | "menu_manager_factory.h", | ||
| 507 | "navigation_observer.cc", | ||
| 508 | "navigation_observer.h", | ||
| 509 | - "omaha_attributes_handler.cc", | ||
| 510 | - "omaha_attributes_handler.h", | ||
| 511 | "pack_extension_job.cc", | ||
| 512 | "pack_extension_job.h", | ||
| 513 | "pending_extension_info.cc", | ||
| 514 | --- chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc.orig | ||
| 515 | +++ chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc | ||
| 516 | @@ -72,17 +72,8 @@ api::enterprise_reporting_private::Conte | ||
| 517 | : nullptr; | ||
| 518 | info.os_firewall = ToInfoSettingValue(signals.os_firewall); | ||
| 519 | info.system_dns_servers = std::move(signals.system_dns_servers); | ||
| 520 | - switch (signals.realtime_url_check_mode) { | ||
| 521 | - case safe_browsing::REAL_TIME_CHECK_DISABLED: | ||
| 522 | info.realtime_url_check_mode = extensions::api:: | ||
| 523 | enterprise_reporting_private::REALTIME_URL_CHECK_MODE_DISABLED; | ||
| 524 | - break; | ||
| 525 | - case safe_browsing::REAL_TIME_CHECK_FOR_MAINFRAME_ENABLED: | ||
| 526 | - info.realtime_url_check_mode = | ||
| 527 | - extensions::api::enterprise_reporting_private:: | ||
| 528 | - REALTIME_URL_CHECK_MODE_ENABLED_MAIN_FRAME; | ||
| 529 | - break; | ||
| 530 | - } | ||
| 531 | info.browser_version = std::move(signals.browser_version); | ||
| 532 | info.built_in_dns_client_enabled = signals.built_in_dns_client_enabled; | ||
| 533 | |||
| 534 | --- chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc.orig | ||
| 535 | +++ chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc | ||
| 536 | @@ -326,6 +326,7 @@ void SafeBrowsingPrivateEventRouter::OnD | ||
| 537 | event_router_->BroadcastEvent(std::move(extension_event)); | ||
| 538 | } | ||
| 539 | |||
| 540 | +#if defined(FULL_SAFE_BROWSING) | ||
| 541 | absl::optional<enterprise_connectors::ReportingSettings> settings = | ||
| 542 | GetReportingSettings(); | ||
| 543 | if (!settings.has_value() || | ||
| 544 | @@ -356,6 +357,7 @@ void SafeBrowsingPrivateEventRouter::OnD | ||
| 545 | |||
| 546 | ReportRealtimeEvent(kKeyDangerousDownloadEvent, std::move(settings.value()), | ||
| 547 | std::move(event)); | ||
| 548 | +#endif // FULL_SAFE_BROWSING | ||
| 549 | } | ||
| 550 | |||
| 551 | void SafeBrowsingPrivateEventRouter::OnSecurityInterstitialShown( | ||
| 552 | @@ -383,6 +385,7 @@ void SafeBrowsingPrivateEventRouter::OnS | ||
| 553 | event_router_->BroadcastEvent(std::move(extension_event)); | ||
| 554 | } | ||
| 555 | |||
| 556 | +#if defined(FULL_SAFE_BROWSING) | ||
| 557 | absl::optional<enterprise_connectors::ReportingSettings> settings = | ||
| 558 | GetReportingSettings(); | ||
| 559 | if (!settings.has_value() || | ||
| 560 | @@ -406,6 +409,7 @@ void SafeBrowsingPrivateEventRouter::OnS | ||
| 561 | |||
| 562 | ReportRealtimeEvent(kKeyInterstitialEvent, std::move(settings.value()), | ||
| 563 | std::move(event)); | ||
| 564 | +#endif // FULL_SAFE_BROWSING | ||
| 565 | } | ||
| 566 | |||
| 567 | void SafeBrowsingPrivateEventRouter::OnSecurityInterstitialProceeded( | ||
| 568 | @@ -433,6 +437,7 @@ void SafeBrowsingPrivateEventRouter::OnS | ||
| 569 | event_router_->BroadcastEvent(std::move(extension_event)); | ||
| 570 | } | ||
| 571 | |||
| 572 | +#if defined(FULL_SAFE_BROWSING) | ||
| 573 | absl::optional<enterprise_connectors::ReportingSettings> settings = | ||
| 574 | GetReportingSettings(); | ||
| 575 | if (!settings.has_value() || | ||
| 576 | @@ -452,6 +457,7 @@ void SafeBrowsingPrivateEventRouter::OnS | ||
| 577 | |||
| 578 | ReportRealtimeEvent(kKeyInterstitialEvent, std::move(settings.value()), | ||
| 579 | std::move(event)); | ||
| 580 | +#endif // FULL_SAFE_BROWSING | ||
| 581 | } | ||
| 582 | |||
| 583 | void SafeBrowsingPrivateEventRouter::OnAnalysisConnectorResult( | ||
| 584 | @@ -465,6 +471,7 @@ void SafeBrowsingPrivateEventRouter::OnA | ||
| 585 | const enterprise_connectors::ContentAnalysisResponse::Result& result, | ||
| 586 | const int64_t content_size, | ||
| 587 | safe_browsing::EventResult event_result) { | ||
| 588 | +#if defined(FULL_SAFE_BROWSING) | ||
| 589 | if (result.tag() == "malware") { | ||
| 590 | DCHECK_EQ(1, result.triggered_rules().size()); | ||
| 591 | OnDangerousDeepScanningResult( | ||
| 592 | @@ -476,6 +483,7 @@ void SafeBrowsingPrivateEventRouter::OnA | ||
| 593 | OnSensitiveDataEvent(url, file_name, download_digest_sha256, mime_type, | ||
| 594 | trigger, scan_id, result, content_size, event_result); | ||
| 595 | } | ||
| 596 | +#endif // FULL_SAFE_BROWSING | ||
| 597 | } | ||
| 598 | |||
| 599 | void SafeBrowsingPrivateEventRouter::OnDangerousDeepScanningResult( | ||
| 600 | @@ -491,6 +499,7 @@ void SafeBrowsingPrivateEventRouter::OnD | ||
| 601 | const std::string& malware_category, | ||
| 602 | const std::string& evidence_locker_filepath, | ||
| 603 | const std::string& scan_id) { | ||
| 604 | +#if defined(FULL_SAFE_BROWSING) | ||
| 605 | absl::optional<enterprise_connectors::ReportingSettings> settings = | ||
| 606 | GetReportingSettings(); | ||
| 607 | if (!settings.has_value() || | ||
| 608 | @@ -528,6 +537,7 @@ void SafeBrowsingPrivateEventRouter::OnD | ||
| 609 | |||
| 610 | ReportRealtimeEvent(kKeyDangerousDownloadEvent, std::move(settings.value()), | ||
| 611 | std::move(event)); | ||
| 612 | +#endif // FULL_SAFE_BROWSING | ||
| 613 | } | ||
| 614 | |||
| 615 | void SafeBrowsingPrivateEventRouter::OnSensitiveDataEvent( | ||
| 616 | @@ -540,6 +550,7 @@ void SafeBrowsingPrivateEventRouter::OnS | ||
| 617 | const enterprise_connectors::ContentAnalysisResponse::Result& result, | ||
| 618 | const int64_t content_size, | ||
| 619 | safe_browsing::EventResult event_result) { | ||
| 620 | +#if defined(FULL_SAFE_BROWSING) | ||
| 621 | absl::optional<enterprise_connectors::ReportingSettings> settings = | ||
| 622 | GetReportingSettings(); | ||
| 623 | if (!settings.has_value() || | ||
| 624 | @@ -572,6 +583,7 @@ void SafeBrowsingPrivateEventRouter::OnS | ||
| 625 | |||
| 626 | ReportRealtimeEvent(kKeySensitiveDataEvent, std::move(settings.value()), | ||
| 627 | std::move(event)); | ||
| 628 | +#endif // FULL_SAFE_BROWSING | ||
| 629 | } | ||
| 630 | |||
| 631 | void SafeBrowsingPrivateEventRouter::OnAnalysisConnectorWarningBypassed( | ||
| 632 | @@ -584,6 +596,7 @@ void SafeBrowsingPrivateEventRouter::OnA | ||
| 633 | safe_browsing::DeepScanAccessPoint access_point, | ||
| 634 | const enterprise_connectors::ContentAnalysisResponse::Result& result, | ||
| 635 | const int64_t content_size) { | ||
| 636 | +#if defined(FULL_SAFE_BROWSING) | ||
| 637 | absl::optional<enterprise_connectors::ReportingSettings> settings = | ||
| 638 | GetReportingSettings(); | ||
| 639 | if (!settings.has_value() || | ||
| 640 | @@ -616,6 +629,7 @@ void SafeBrowsingPrivateEventRouter::OnA | ||
| 641 | |||
| 642 | ReportRealtimeEvent(kKeySensitiveDataEvent, std::move(settings.value()), | ||
| 643 | std::move(event)); | ||
| 644 | +#endif // FULL_SAFE_BROWSING | ||
| 645 | } | ||
| 646 | |||
| 647 | void SafeBrowsingPrivateEventRouter::OnUnscannedFileEvent( | ||
| 648 | @@ -628,6 +642,7 @@ void SafeBrowsingPrivateEventRouter::OnU | ||
| 649 | const std::string& reason, | ||
| 650 | const int64_t content_size, | ||
| 651 | safe_browsing::EventResult event_result) { | ||
| 652 | +#if defined(FULL_SAFE_BROWSING) | ||
| 653 | absl::optional<enterprise_connectors::ReportingSettings> settings = | ||
| 654 | GetReportingSettings(); | ||
| 655 | if (!settings.has_value() || | ||
| 656 | @@ -654,6 +669,7 @@ void SafeBrowsingPrivateEventRouter::OnU | ||
| 657 | |||
| 658 | ReportRealtimeEvent(kKeyUnscannedFileEvent, std::move(settings.value()), | ||
| 659 | std::move(event)); | ||
| 660 | +#endif // FULL_SAFE_BROWSING | ||
| 661 | } | ||
| 662 | |||
| 663 | void SafeBrowsingPrivateEventRouter::OnDangerousDownloadEvent( | ||
| 664 | @@ -679,6 +695,7 @@ void SafeBrowsingPrivateEventRouter::OnD | ||
| 665 | const std::string& scan_id, | ||
| 666 | const int64_t content_size, | ||
| 667 | safe_browsing::EventResult event_result) { | ||
| 668 | +#if defined(FULL_SAFE_BROWSING) | ||
| 669 | absl::optional<enterprise_connectors::ReportingSettings> settings = | ||
| 670 | GetReportingSettings(); | ||
| 671 | if (!settings.has_value() || | ||
| 672 | @@ -709,6 +726,7 @@ void SafeBrowsingPrivateEventRouter::OnD | ||
| 673 | |||
| 674 | ReportRealtimeEvent(kKeyDangerousDownloadEvent, std::move(settings.value()), | ||
| 675 | std::move(event)); | ||
| 676 | +#endif | ||
| 677 | } | ||
| 678 | |||
| 679 | void SafeBrowsingPrivateEventRouter::OnDangerousDownloadWarningBypassed( | ||
| 680 | @@ -732,6 +750,7 @@ void SafeBrowsingPrivateEventRouter::OnD | ||
| 681 | const std::string& mime_type, | ||
| 682 | const std::string& scan_id, | ||
| 683 | const int64_t content_size) { | ||
| 684 | +#if defined(FULL_SAFE_BROWSING) | ||
| 685 | absl::optional<enterprise_connectors::ReportingSettings> settings = | ||
| 686 | GetReportingSettings(); | ||
| 687 | if (!settings.has_value() || | ||
| 688 | @@ -762,6 +781,7 @@ void SafeBrowsingPrivateEventRouter::OnD | ||
| 689 | |||
| 690 | ReportRealtimeEvent(kKeyDangerousDownloadEvent, std::move(settings.value()), | ||
| 691 | std::move(event)); | ||
| 692 | +#endif // FULL_SAFE_BROWSING | ||
| 693 | } | ||
| 694 | |||
| 695 | void SafeBrowsingPrivateEventRouter::OnLoginEvent( | ||
| 696 | @@ -1087,7 +1107,11 @@ void SafeBrowsingPrivateEventRouter::Rep | ||
| 697 | } | ||
| 698 | |||
| 699 | std::string SafeBrowsingPrivateEventRouter::GetProfileUserName() const { | ||
| 700 | +#if defined(FULL_SAFE_BROWSING) | ||
| 701 | return safe_browsing::GetProfileEmail(identity_manager_); | ||
| 702 | +#else | ||
| 703 | + return ""; | ||
| 704 | +#endif | ||
| 705 | } | ||
| 706 | |||
| 707 | #if BUILDFLAG(IS_CHROMEOS_ASH) | ||
| 708 | --- chrome/browser/extensions/extension_service.cc.orig | ||
| 709 | +++ chrome/browser/extensions/extension_service.cc | ||
| 710 | @@ -52,7 +52,6 @@ | ||
| 711 | #include "chrome/browser/extensions/forced_extensions/install_stage_tracker.h" | ||
| 712 | #include "chrome/browser/extensions/install_verifier.h" | ||
| 713 | #include "chrome/browser/extensions/installed_loader.h" | ||
| 714 | -#include "chrome/browser/extensions/omaha_attributes_handler.h" | ||
| 715 | #include "chrome/browser/extensions/pending_extension_manager.h" | ||
| 716 | #include "chrome/browser/extensions/permissions_updater.h" | ||
| 717 | #include "chrome/browser/extensions/shared_module_service.h" | ||
| 718 | @@ -370,7 +369,6 @@ ExtensionService::ExtensionService(Profi | ||
| 719 | safe_browsing_verdict_handler_(extension_prefs, | ||
| 720 | ExtensionRegistry::Get(profile), | ||
| 721 | this), | ||
| 722 | - omaha_attributes_handler_(extension_prefs, this), | ||
| 723 | registry_(ExtensionRegistry::Get(profile)), | ||
| 724 | pending_extension_manager_(profile), | ||
| 725 | install_directory_(install_directory), | ||
| 726 | @@ -852,47 +850,6 @@ bool ExtensionService::IsExtensionEnable | ||
| 727 | return extension_registrar_.IsExtensionEnabled(extension_id); | ||
| 728 | } | ||
| 729 | |||
| 730 | -void ExtensionService::PerformActionBasedOnOmahaAttributes( | ||
| 731 | - const std::string& extension_id, | ||
| 732 | - const base::Value& attributes) { | ||
| 733 | - DCHECK_CURRENTLY_ON(BrowserThread::UI); | ||
| 734 | - HandleMalwareOmahaAttribute(extension_id, attributes); | ||
| 735 | - omaha_attributes_handler_.PerformActionBasedOnOmahaAttributes(extension_id, | ||
| 736 | - attributes); | ||
| 737 | - allowlist_.PerformActionBasedOnOmahaAttributes(extension_id, attributes); | ||
| 738 | -} | ||
| 739 | - | ||
| 740 | -void ExtensionService::HandleMalwareOmahaAttribute( | ||
| 741 | - const std::string& extension_id, | ||
| 742 | - const base::Value& attributes) { | ||
| 743 | - bool has_malware_value = | ||
| 744 | - OmahaAttributesHandler::HasOmahaBlocklistStateInAttributes( | ||
| 745 | - attributes, BitMapBlocklistState::BLOCKLISTED_MALWARE); | ||
| 746 | - if (!has_malware_value) { | ||
| 747 | - OmahaAttributesHandler::ReportNoUpdateCheckKeys(); | ||
| 748 | - // Omaha attributes may have previously have the "_malware" key. | ||
| 749 | - MaybeEnableRemotelyDisabledExtension(extension_id); | ||
| 750 | - return; | ||
| 751 | - } | ||
| 752 | - | ||
| 753 | - if (extension_prefs_->HasDisableReason( | ||
| 754 | - extension_id, disable_reason::DISABLE_REMOTELY_FOR_MALWARE)) { | ||
| 755 | - // The extension is already disabled. No work needs to be done. | ||
| 756 | - return; | ||
| 757 | - } | ||
| 758 | - | ||
| 759 | - OmahaAttributesHandler::ReportExtensionDisabledRemotely( | ||
| 760 | - extension_registrar_.IsExtensionEnabled(extension_id), | ||
| 761 | - ExtensionUpdateCheckDataKey::kMalware); | ||
| 762 | - | ||
| 763 | - // Add the extension to the blocklisted extensions set. | ||
| 764 | - UpdateBlocklistedExtensions({extension_id}, | ||
| 765 | - registry_->blocklisted_extensions().GetIDs()); | ||
| 766 | - extension_prefs_->AddDisableReason( | ||
| 767 | - extension_id, disable_reason::DISABLE_REMOTELY_FOR_MALWARE); | ||
| 768 | - // Show an error for the newly blocklisted extension. | ||
| 769 | - error_controller_->ShowErrorIfNeeded(); | ||
| 770 | -} | ||
| 771 | |||
| 772 | void ExtensionService::MaybeEnableRemotelyDisabledExtension( | ||
| 773 | const std::string& extension_id) { | ||
| 774 | @@ -909,56 +866,6 @@ void ExtensionService::MaybeEnableRemote | ||
| 775 | unchanged.erase(extension_id); | ||
| 776 | // Remove the extension from the blocklist. | ||
| 777 | UpdateBlocklistedExtensions({}, unchanged); | ||
| 778 | - OmahaAttributesHandler::ReportReenableExtension( | ||
| 779 | - ExtensionUpdateCheckDataKey::kMalware); | ||
| 780 | -} | ||
| 781 | - | ||
| 782 | -void ExtensionService::ClearGreylistedAcknowledgedStateAndMaybeReenable( | ||
| 783 | - const std::string& extension_id) { | ||
| 784 | - bool is_on_sb_list = (blocklist_prefs::GetSafeBrowsingExtensionBlocklistState( | ||
| 785 | - extension_id, extension_prefs_) != | ||
| 786 | - BitMapBlocklistState::NOT_BLOCKLISTED); | ||
| 787 | - bool is_on_omaha_list = | ||
| 788 | - blocklist_prefs::HasAnyOmahaGreylistState(extension_id, extension_prefs_); | ||
| 789 | - if (is_on_sb_list || is_on_omaha_list) { | ||
| 790 | - return; | ||
| 791 | - } | ||
| 792 | - // Clear all acknowledged states so the extension will still get disabled if | ||
| 793 | - // it is added to the greylist again. | ||
| 794 | - blocklist_prefs::ClearAcknowledgedGreylistStates(extension_id, | ||
| 795 | - extension_prefs_); | ||
| 796 | - RemoveDisableReasonAndMaybeEnable(extension_id, | ||
| 797 | - disable_reason::DISABLE_GREYLIST); | ||
| 798 | -} | ||
| 799 | - | ||
| 800 | -void ExtensionService::MaybeDisableGreylistedExtension( | ||
| 801 | - const std::string& extension_id, | ||
| 802 | - BitMapBlocklistState new_state) { | ||
| 803 | -#if DCHECK_IS_ON() | ||
| 804 | - bool has_new_state_on_sb_list = | ||
| 805 | - (blocklist_prefs::GetSafeBrowsingExtensionBlocklistState( | ||
| 806 | - extension_id, extension_prefs_) == new_state); | ||
| 807 | - bool has_new_state_on_omaha_list = blocklist_prefs::HasOmahaBlocklistState( | ||
| 808 | - extension_id, new_state, extension_prefs_); | ||
| 809 | - DCHECK(has_new_state_on_sb_list || has_new_state_on_omaha_list); | ||
| 810 | -#endif | ||
| 811 | - if (blocklist_prefs::HasAcknowledgedBlocklistState(extension_id, new_state, | ||
| 812 | - extension_prefs_)) { | ||
| 813 | - // If the extension is already acknowledged, don't disable it again | ||
| 814 | - // because it can be already re-enabled by the user. This could happen if | ||
| 815 | - // the extension is added to the SafeBrowsing blocklist, and then | ||
| 816 | - // subsequently marked by Omaha. In this case, we don't want to disable the | ||
| 817 | - // extension twice. | ||
| 818 | - return; | ||
| 819 | - } | ||
| 820 | - | ||
| 821 | - // Set the current greylist states to acknowledge immediately because the | ||
| 822 | - // extension is disabled silently. Clear the other acknowledged state because | ||
| 823 | - // when the state changes to another greylist state in the future, we'd like | ||
| 824 | - // to disable the extension again. | ||
| 825 | - blocklist_prefs::UpdateCurrentGreylistStatesAsAcknowledged(extension_id, | ||
| 826 | - extension_prefs_); | ||
| 827 | - DisableExtension(extension_id, disable_reason::DISABLE_GREYLIST); | ||
| 828 | } | ||
| 829 | |||
| 830 | void ExtensionService::RemoveDisableReasonAndMaybeEnable( | ||
| 831 | --- chrome/browser/extensions/extension_service.h.orig | ||
| 832 | +++ chrome/browser/extensions/extension_service.h | ||
| 833 | @@ -25,7 +25,6 @@ | ||
| 834 | #include "chrome/browser/extensions/forced_extensions/force_installed_metrics.h" | ||
| 835 | #include "chrome/browser/extensions/forced_extensions/force_installed_tracker.h" | ||
| 836 | #include "chrome/browser/extensions/install_gate.h" | ||
| 837 | -#include "chrome/browser/extensions/omaha_attributes_handler.h" | ||
| 838 | #include "chrome/browser/extensions/pending_extension_manager.h" | ||
| 839 | #include "chrome/browser/extensions/safe_browsing_verdict_handler.h" | ||
| 840 | #include "chrome/browser/profiles/profile_manager.h" | ||
| 841 | @@ -269,28 +268,11 @@ class ExtensionService : public Extensio | ||
| 842 | // nothing. | ||
| 843 | void EnableExtension(const std::string& extension_id); | ||
| 844 | |||
| 845 | - // Takes Safe Browsing and Omaha blocklist states into account and decides | ||
| 846 | - // whether to remove greylist disabled reason. Called when a greylisted | ||
| 847 | - // state is removed from the Safe Browsing blocklist or Omaha blocklist. Also | ||
| 848 | - // clears all acknowledged states if the greylist disabled reason is removed. | ||
| 849 | - void ClearGreylistedAcknowledgedStateAndMaybeReenable( | ||
| 850 | - const std::string& extension_id); | ||
| 851 | - | ||
| 852 | - // Takes acknowledged blocklist states into account and decides whether to | ||
| 853 | - // disable the greylisted extension. Called when a new greylisted state is | ||
| 854 | - // added to the Safe Browsing blocklist or Omaha blocklist. | ||
| 855 | - void MaybeDisableGreylistedExtension(const std::string& extension_id, | ||
| 856 | - BitMapBlocklistState new_state); | ||
| 857 | - | ||
| 858 | // Removes the disable reason and enable the extension if there are no disable | ||
| 859 | // reasons left and is not blocked for another reason. | ||
| 860 | void RemoveDisableReasonAndMaybeEnable(const std::string& extension_id, | ||
| 861 | disable_reason::DisableReason reason); | ||
| 862 | |||
| 863 | - // Performs action based on Omaha attributes for the extension. | ||
| 864 | - void PerformActionBasedOnOmahaAttributes(const std::string& extension_id, | ||
| 865 | - const base::Value& attributes); | ||
| 866 | - | ||
| 867 | // Disables the extension. If the extension is already disabled, just adds | ||
| 868 | // the |disable_reasons| (a bitmask of disable_reason::DisableReason - there | ||
| 869 | // can be multiple DisableReasons e.g. when an extension comes in disabled | ||
| 870 | @@ -562,11 +544,6 @@ class ExtensionService : public Extensio | ||
| 871 | // Helper method to determine if an extension can be blocked. | ||
| 872 | bool CanBlockExtension(const Extension* extension) const; | ||
| 873 | |||
| 874 | - // Handles the malware Omaha attribute for remotely disabled extensions. | ||
| 875 | - // TODO(crbug.com/1193695): Move this function to OmahaAttributesHandler. | ||
| 876 | - void HandleMalwareOmahaAttribute(const std::string& extension_id, | ||
| 877 | - const base::Value& attributes); | ||
| 878 | - | ||
| 879 | // Enables an extension that was only previously disabled remotely. | ||
| 880 | void MaybeEnableRemotelyDisabledExtension(const std::string& extension_id); | ||
| 881 | |||
| 882 | @@ -639,8 +616,6 @@ class ExtensionService : public Extensio | ||
| 883 | |||
| 884 | SafeBrowsingVerdictHandler safe_browsing_verdict_handler_; | ||
| 885 | |||
| 886 | - OmahaAttributesHandler omaha_attributes_handler_; | ||
| 887 | - | ||
| 888 | // Sets of enabled/disabled/terminated/blocklisted extensions. Not owned. | ||
| 889 | ExtensionRegistry* registry_ = nullptr; | ||
| 890 | |||
| 891 | --- chrome/browser/extensions/extension_system_impl.cc.orig | ||
| 892 | +++ chrome/browser/extensions/extension_system_impl.cc | ||
| 893 | @@ -465,8 +465,6 @@ void ExtensionSystemImpl::InstallUpdate( | ||
| 894 | void ExtensionSystemImpl::PerformActionBasedOnOmahaAttributes( | ||
| 895 | const std::string& extension_id, | ||
| 896 | const base::Value& attributes) { | ||
| 897 | - extension_service()->PerformActionBasedOnOmahaAttributes(extension_id, | ||
| 898 | - attributes); | ||
| 899 | } | ||
| 900 | |||
| 901 | bool ExtensionSystemImpl::FinishDelayedInstallationIfReady( | ||
| 902 | --- chrome/browser/extensions/safe_browsing_verdict_handler.cc.orig | ||
| 903 | +++ chrome/browser/extensions/safe_browsing_verdict_handler.cc | ||
| 904 | @@ -101,8 +101,6 @@ void SafeBrowsingVerdictHandler::UpdateG | ||
| 905 | blocklist_prefs::SetSafeBrowsingExtensionBlocklistState( | ||
| 906 | extension->id(), BitMapBlocklistState::NOT_BLOCKLISTED, | ||
| 907 | extension_prefs_); | ||
| 908 | - extension_service_->ClearGreylistedAcknowledgedStateAndMaybeReenable( | ||
| 909 | - extension->id()); | ||
| 910 | UMA_HISTOGRAM_ENUMERATION("Extensions.Greylist.Enabled", | ||
| 911 | extension->location()); | ||
| 912 | } | ||
| 913 | @@ -125,8 +123,6 @@ void SafeBrowsingVerdictHandler::UpdateG | ||
| 914 | blocklist_prefs::BlocklistStateToBitMapBlocklistState(greylist_state); | ||
| 915 | blocklist_prefs::SetSafeBrowsingExtensionBlocklistState( | ||
| 916 | extension->id(), bitmap_greylist_state, extension_prefs_); | ||
| 917 | - extension_service_->MaybeDisableGreylistedExtension(id, | ||
| 918 | - bitmap_greylist_state); | ||
| 919 | UMA_HISTOGRAM_ENUMERATION("Extensions.Greylist.Disabled", | ||
| 920 | extension->location()); | ||
| 921 | } | ||
| 922 | --- chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc.orig | ||
| 923 | +++ chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc | ||
| 924 | @@ -35,8 +35,6 @@ | ||
| 925 | #include "chrome/browser/file_system_access/file_system_access_permission_request_manager.h" | ||
| 926 | #include "chrome/browser/installable/installable_utils.h" | ||
| 927 | #include "chrome/browser/profiles/profile.h" | ||
| 928 | -#include "chrome/browser/safe_browsing/download_protection/download_protection_service.h" | ||
| 929 | -#include "chrome/browser/safe_browsing/safe_browsing_service.h" | ||
| 930 | #include "chrome/browser/ui/file_system_access_dialogs.h" | ||
| 931 | #include "chrome/common/chrome_paths.h" | ||
| 932 | #include "components/content_settings/core/browser/host_content_settings_map.h" | ||
| 933 | @@ -299,83 +297,6 @@ BindResultCallbackToCurrentSequence( | ||
| 934 | base::SequencedTaskRunnerHandle::Get(), std::move(callback)); | ||
| 935 | } | ||
| 936 | |||
| 937 | -void DoSafeBrowsingCheckOnUIThread( | ||
| 938 | - content::GlobalRenderFrameHostId frame_id, | ||
| 939 | - std::unique_ptr<content::FileSystemAccessWriteItem> item, | ||
| 940 | - safe_browsing::CheckDownloadCallback callback) { | ||
| 941 | - DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | ||
| 942 | - // Download Protection Service is not supported on Android. | ||
| 943 | -#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 944 | - safe_browsing::SafeBrowsingService* sb_service = | ||
| 945 | - g_browser_process->safe_browsing_service(); | ||
| 946 | - if (!sb_service || !sb_service->download_protection_service() || | ||
| 947 | - !sb_service->download_protection_service()->enabled()) { | ||
| 948 | - std::move(callback).Run(safe_browsing::DownloadCheckResult::UNKNOWN); | ||
| 949 | - return; | ||
| 950 | - } | ||
| 951 | - | ||
| 952 | - if (!item->browser_context) { | ||
| 953 | - content::RenderProcessHost* rph = | ||
| 954 | - content::RenderProcessHost::FromID(frame_id.child_id); | ||
| 955 | - if (!rph) { | ||
| 956 | - std::move(callback).Run(safe_browsing::DownloadCheckResult::UNKNOWN); | ||
| 957 | - return; | ||
| 958 | - } | ||
| 959 | - item->browser_context = rph->GetBrowserContext(); | ||
| 960 | - } | ||
| 961 | - | ||
| 962 | - if (!item->web_contents) { | ||
| 963 | - content::RenderFrameHost* rfh = content::RenderFrameHost::FromID(frame_id); | ||
| 964 | - if (rfh) { | ||
| 965 | - DCHECK_NE(rfh->GetLifecycleState(), | ||
| 966 | - content::RenderFrameHost::LifecycleState::kPrerendering); | ||
| 967 | - item->web_contents = content::WebContents::FromRenderFrameHost(rfh); | ||
| 968 | - } | ||
| 969 | - } | ||
| 970 | - | ||
| 971 | - sb_service->download_protection_service()->CheckFileSystemAccessWrite( | ||
| 972 | - std::move(item), std::move(callback)); | ||
| 973 | -#endif | ||
| 974 | -} | ||
| 975 | - | ||
| 976 | -ChromeFileSystemAccessPermissionContext::AfterWriteCheckResult | ||
| 977 | -InterpretSafeBrowsingResult(safe_browsing::DownloadCheckResult result) { | ||
| 978 | - using Result = safe_browsing::DownloadCheckResult; | ||
| 979 | - switch (result) { | ||
| 980 | - // Only allow downloads that are marked as SAFE or UNKNOWN by SafeBrowsing. | ||
| 981 | - // All other types are going to be blocked. UNKNOWN could be the result of a | ||
| 982 | - // failed safe browsing ping. | ||
| 983 | - case Result::UNKNOWN: | ||
| 984 | - case Result::SAFE: | ||
| 985 | - case Result::ALLOWLISTED_BY_POLICY: | ||
| 986 | - return ChromeFileSystemAccessPermissionContext::AfterWriteCheckResult:: | ||
| 987 | - kAllow; | ||
| 988 | - | ||
| 989 | - case Result::DANGEROUS: | ||
| 990 | - case Result::UNCOMMON: | ||
| 991 | - case Result::DANGEROUS_HOST: | ||
| 992 | - case Result::POTENTIALLY_UNWANTED: | ||
| 993 | - case Result::BLOCKED_PASSWORD_PROTECTED: | ||
| 994 | - case Result::BLOCKED_TOO_LARGE: | ||
| 995 | - case Result::BLOCKED_UNSUPPORTED_FILE_TYPE: | ||
| 996 | - case Result::DANGEROUS_ACCOUNT_COMPROMISE: | ||
| 997 | - return ChromeFileSystemAccessPermissionContext::AfterWriteCheckResult:: | ||
| 998 | - kBlock; | ||
| 999 | - | ||
| 1000 | - // This shouldn't be returned for File System Access write checks. | ||
| 1001 | - case Result::ASYNC_SCANNING: | ||
| 1002 | - case Result::SENSITIVE_CONTENT_WARNING: | ||
| 1003 | - case Result::SENSITIVE_CONTENT_BLOCK: | ||
| 1004 | - case Result::DEEP_SCANNED_SAFE: | ||
| 1005 | - case Result::PROMPT_FOR_SCANNING: | ||
| 1006 | - NOTREACHED(); | ||
| 1007 | - return ChromeFileSystemAccessPermissionContext::AfterWriteCheckResult:: | ||
| 1008 | - kAllow; | ||
| 1009 | - } | ||
| 1010 | - NOTREACHED(); | ||
| 1011 | - return ChromeFileSystemAccessPermissionContext::AfterWriteCheckResult::kBlock; | ||
| 1012 | -} | ||
| 1013 | - | ||
| 1014 | std::string GenerateLastPickedDirectoryKey(const std::string& id) { | ||
| 1015 | return id.empty() ? kDefaultLastPickedDirectoryKey | ||
| 1016 | : base::StrCat({kCustomLastPickedDirectoryKey, "-", id}); | ||
| 1017 | @@ -1106,28 +1027,6 @@ void ChromeFileSystemAccessPermissionCon | ||
| 1018 | std::move(callback))); | ||
| 1019 | } | ||
| 1020 | |||
| 1021 | -void ChromeFileSystemAccessPermissionContext::PerformAfterWriteChecks( | ||
| 1022 | - std::unique_ptr<content::FileSystemAccessWriteItem> item, | ||
| 1023 | - content::GlobalRenderFrameHostId frame_id, | ||
| 1024 | - base::OnceCallback<void(AfterWriteCheckResult)> callback) { | ||
| 1025 | - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | ||
| 1026 | - content::GetUIThreadTaskRunner({})->PostTask( | ||
| 1027 | - FROM_HERE, | ||
| 1028 | - base::BindOnce( | ||
| 1029 | - &DoSafeBrowsingCheckOnUIThread, frame_id, std::move(item), | ||
| 1030 | - base::BindOnce( | ||
| 1031 | - [](scoped_refptr<base::TaskRunner> task_runner, | ||
| 1032 | - base::OnceCallback<void(AfterWriteCheckResult result)> | ||
| 1033 | - callback, | ||
| 1034 | - safe_browsing::DownloadCheckResult result) { | ||
| 1035 | - task_runner->PostTask( | ||
| 1036 | - FROM_HERE, | ||
| 1037 | - base::BindOnce(std::move(callback), | ||
| 1038 | - InterpretSafeBrowsingResult(result))); | ||
| 1039 | - }, | ||
| 1040 | - base::SequencedTaskRunnerHandle::Get(), std::move(callback)))); | ||
| 1041 | -} | ||
| 1042 | - | ||
| 1043 | void ChromeFileSystemAccessPermissionContext:: | ||
| 1044 | DidConfirmSensitiveDirectoryAccess( | ||
| 1045 | const url::Origin& origin, | ||
| 1046 | --- chrome/browser/file_system_access/chrome_file_system_access_permission_context.h.orig | ||
| 1047 | +++ chrome/browser/file_system_access/chrome_file_system_access_permission_context.h | ||
| 1048 | @@ -85,10 +85,6 @@ class ChromeFileSystemAccessPermissionCo | ||
| 1049 | HandleType handle_type, | ||
| 1050 | content::GlobalRenderFrameHostId frame_id, | ||
| 1051 | base::OnceCallback<void(SensitiveDirectoryResult)> callback) override; | ||
| 1052 | - void PerformAfterWriteChecks( | ||
| 1053 | - std::unique_ptr<content::FileSystemAccessWriteItem> item, | ||
| 1054 | - content::GlobalRenderFrameHostId frame_id, | ||
| 1055 | - base::OnceCallback<void(AfterWriteCheckResult)> callback) override; | ||
| 1056 | bool CanObtainReadPermission(const url::Origin& origin) override; | ||
| 1057 | bool CanObtainWritePermission(const url::Origin& origin) override; | ||
| 1058 | |||
| 1059 | --- chrome/browser/media/webrtc/display_media_access_handler.cc.orig | ||
| 1060 | +++ chrome/browser/media/webrtc/display_media_access_handler.cc | ||
| 1061 | @@ -25,6 +25,7 @@ | ||
| 1062 | #include "chrome/browser/safe_browsing/user_interaction_observer.h" | ||
| 1063 | #include "chrome/common/pref_names.h" | ||
| 1064 | #include "components/prefs/pref_service.h" | ||
| 1065 | +#include "components/safe_browsing/buildflags.h" | ||
| 1066 | #include "components/url_formatter/elide_url.h" | ||
| 1067 | #include "content/public/browser/browser_thread.h" | ||
| 1068 | #include "content/public/browser/desktop_capture.h" | ||
| 1069 | @@ -111,6 +112,7 @@ void DisplayMediaAccessHandler::HandleRe | ||
| 1070 | return; | ||
| 1071 | } | ||
| 1072 | |||
| 1073 | + #if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1074 | // SafeBrowsing Delayed Warnings experiment can delay some SafeBrowsing | ||
| 1075 | // warnings until user interaction. If the current page has a delayed warning, | ||
| 1076 | // it'll have a user interaction observer attached. Show the warning | ||
| 1077 | @@ -125,6 +127,7 @@ void DisplayMediaAccessHandler::HandleRe | ||
| 1078 | observer->OnDesktopCaptureRequest(); | ||
| 1079 | return; | ||
| 1080 | } | ||
| 1081 | + #endif // BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1082 | |||
| 1083 | #if defined(OS_MAC) | ||
| 1084 | // Do not allow picker UI to be shown on a page that isn't in the foreground | ||
| 1085 | --- chrome/browser/password_manager/chrome_password_manager_client.cc.orig | ||
| 1086 | +++ chrome/browser/password_manager/chrome_password_manager_client.cc | ||
| 1087 | @@ -33,7 +33,6 @@ | ||
| 1088 | #include "chrome/browser/password_manager/password_reuse_manager_factory.h" | ||
| 1089 | #include "chrome/browser/password_manager/password_store_factory.h" | ||
| 1090 | #include "chrome/browser/profiles/profile.h" | ||
| 1091 | -#include "chrome/browser/safe_browsing/chrome_password_protection_service.h" | ||
| 1092 | #include "chrome/browser/safe_browsing/user_interaction_observer.h" | ||
| 1093 | #include "chrome/browser/signin/identity_manager_factory.h" | ||
| 1094 | #include "chrome/browser/sync/sync_service_factory.h" | ||
| 1095 | @@ -110,11 +109,11 @@ | ||
| 1096 | #if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1097 | #include "chrome/browser/safe_browsing/advanced_protection_status_manager.h" | ||
| 1098 | #include "chrome/browser/safe_browsing/advanced_protection_status_manager_factory.h" | ||
| 1099 | +#endif | ||
| 1100 | #include "third_party/blink/public/mojom/clipboard/clipboard.mojom.h" | ||
| 1101 | #include "ui/base/clipboard/clipboard.h" | ||
| 1102 | #include "ui/base/data_transfer_policy/data_transfer_endpoint.h" | ||
| 1103 | #include "ui/events/keycodes/keyboard_codes.h" | ||
| 1104 | -#endif | ||
| 1105 | |||
| 1106 | #if defined(OS_ANDROID) | ||
| 1107 | #include "chrome/browser/android/tab_android.h" | ||
| 1108 | @@ -826,6 +825,7 @@ autofill::LanguageCode ChromePasswordMan | ||
| 1109 | return autofill::LanguageCode(); | ||
| 1110 | } | ||
| 1111 | |||
| 1112 | +#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1113 | safe_browsing::PasswordProtectionService* | ||
| 1114 | ChromePasswordManagerClient::GetPasswordProtectionService() const { | ||
| 1115 | return safe_browsing::ChromePasswordProtectionService:: | ||
| 1116 | @@ -836,13 +836,6 @@ ChromePasswordManagerClient::GetPassword | ||
| 1117 | void ChromePasswordManagerClient::CheckSafeBrowsingReputation( | ||
| 1118 | const GURL& form_action, | ||
| 1119 | const GURL& frame_url) { | ||
| 1120 | - safe_browsing::PasswordProtectionService* pps = | ||
| 1121 | - GetPasswordProtectionService(); | ||
| 1122 | - if (pps) { | ||
| 1123 | - pps->MaybeStartPasswordFieldOnFocusRequest( | ||
| 1124 | - web_contents(), web_contents()->GetLastCommittedURL(), form_action, | ||
| 1125 | - frame_url, pps->GetAccountInfo().hosted_domain); | ||
| 1126 | - } | ||
| 1127 | } | ||
| 1128 | #endif // defined(ON_FOCUS_PING_ENABLED) | ||
| 1129 | |||
| 1130 | @@ -852,22 +845,10 @@ void ChromePasswordManagerClient::CheckP | ||
| 1131 | const std::vector<password_manager::MatchingReusedCredential>& | ||
| 1132 | matching_reused_credentials, | ||
| 1133 | bool password_field_exists) { | ||
| 1134 | - safe_browsing::PasswordProtectionService* pps = | ||
| 1135 | - GetPasswordProtectionService(); | ||
| 1136 | - if (!pps) | ||
| 1137 | - return; | ||
| 1138 | - | ||
| 1139 | - pps->MaybeStartProtectedPasswordEntryRequest( | ||
| 1140 | - web_contents(), web_contents()->GetLastCommittedURL(), username, | ||
| 1141 | - password_type, matching_reused_credentials, password_field_exists); | ||
| 1142 | } | ||
| 1143 | +#endif // BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1144 | |||
| 1145 | void ChromePasswordManagerClient::LogPasswordReuseDetectedEvent() { | ||
| 1146 | - safe_browsing::PasswordProtectionService* pps = | ||
| 1147 | - GetPasswordProtectionService(); | ||
| 1148 | - if (pps) { | ||
| 1149 | - pps->MaybeLogPasswordReuseDetectedEvent(web_contents()); | ||
| 1150 | - } | ||
| 1151 | } | ||
| 1152 | |||
| 1153 | #if !defined(OS_ANDROID) | ||
| 1154 | @@ -1365,9 +1346,11 @@ void ChromePasswordManagerClient::OnPast | ||
| 1155 | } | ||
| 1156 | |||
| 1157 | was_on_paste_called_ = true; | ||
| 1158 | +#if defined(SYNC_PASSWORD_REUSE_WARNING_ENABLED) | ||
| 1159 | password_reuse_detection_manager_.OnPaste(std::move(text)); | ||
| 1160 | +#endif // defined(SYNC_PASSWORD_REUSE_WARNING_ENABLED) | ||
| 1161 | } | ||
| 1162 | -#endif | ||
| 1163 | +#endif // !defined(OS_ANDROID) | ||
| 1164 | |||
| 1165 | void ChromePasswordManagerClient::RenderFrameCreated( | ||
| 1166 | content::RenderFrameHost* render_frame_host) { | ||
| 1167 | @@ -1402,7 +1385,9 @@ void ChromePasswordManagerClient::OnInpu | ||
| 1168 | if (key_event.windows_key_code == (ui::VKEY_V & 0x1f)) { | ||
| 1169 | OnPaste(); | ||
| 1170 | } else { | ||
| 1171 | +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) | ||
| 1172 | password_reuse_detection_manager_.OnKeyPressedCommitted(key_event.text); | ||
| 1173 | +#endif // defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) | ||
| 1174 | } | ||
| 1175 | #endif // defined(OS_ANDROID) | ||
| 1176 | } | ||
| 1177 | @@ -1441,6 +1426,7 @@ bool ChromePasswordManagerClient::IsPass | ||
| 1178 | is_enabled = false; | ||
| 1179 | } | ||
| 1180 | |||
| 1181 | + #if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1182 | // SafeBrowsing Delayed Warnings experiment can delay some SafeBrowsing | ||
| 1183 | // warnings until user interaction. If the current page has a delayed warning, | ||
| 1184 | // it'll have a user interaction observer attached. Disable password | ||
| 1185 | @@ -1451,6 +1437,7 @@ bool ChromePasswordManagerClient::IsPass | ||
| 1186 | observer->OnPasswordSaveOrAutofillDenied(); | ||
| 1187 | is_enabled = false; | ||
| 1188 | } | ||
| 1189 | + #endif // BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1190 | |||
| 1191 | if (log_manager_->IsLoggingActive()) { | ||
| 1192 | password_manager::BrowserSavePasswordProgressLogger logger( | ||
| 1193 | --- chrome/browser/password_manager/chrome_password_manager_client.h.orig | ||
| 1194 | +++ chrome/browser/password_manager/chrome_password_manager_client.h | ||
| 1195 | @@ -207,13 +207,14 @@ class ChromePasswordManagerClient | ||
| 1196 | void AnnotateNavigationEntry(bool has_password_field) override; | ||
| 1197 | autofill::LanguageCode GetPageLanguage() const override; | ||
| 1198 | |||
| 1199 | +#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1200 | safe_browsing::PasswordProtectionService* GetPasswordProtectionService() | ||
| 1201 | const override; | ||
| 1202 | |||
| 1203 | #if defined(ON_FOCUS_PING_ENABLED) | ||
| 1204 | void CheckSafeBrowsingReputation(const GURL& form_action, | ||
| 1205 | const GURL& frame_url) override; | ||
| 1206 | -#endif | ||
| 1207 | +#endif // defined(ON_FOCUS_PING_ENABLED) | ||
| 1208 | |||
| 1209 | void CheckProtectedPasswordEntry( | ||
| 1210 | password_manager::metrics_util::PasswordType reused_password_type, | ||
| 1211 | @@ -221,6 +222,7 @@ class ChromePasswordManagerClient | ||
| 1212 | const std::vector<password_manager::MatchingReusedCredential>& | ||
| 1213 | matching_reused_credentials, | ||
| 1214 | bool password_field_exists) override; | ||
| 1215 | +#endif // BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1216 | |||
| 1217 | void LogPasswordReuseDetectedEvent() override; | ||
| 1218 | |||
| 1219 | --- chrome/browser/permissions/abusive_origin_permission_revocation_request.cc.orig | ||
| 1220 | +++ chrome/browser/permissions/abusive_origin_permission_revocation_request.cc | ||
| 1221 | @@ -136,6 +136,7 @@ void AbusiveOriginPermissionRevocationRe | ||
| 1222 | DCHECK(profile_); | ||
| 1223 | DCHECK(callback_); | ||
| 1224 | |||
| 1225 | +#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1226 | if (!AbusiveOriginNotificationsPermissionRevocationConfig::IsEnabled() || | ||
| 1227 | !safe_browsing::IsSafeBrowsingEnabled(*profile_->GetPrefs()) || | ||
| 1228 | IsOriginExemptedFromFutureRevocations(profile_, origin_)) { | ||
| 1229 | @@ -182,6 +183,7 @@ void AbusiveOriginPermissionRevocationRe | ||
| 1230 | } | ||
| 1231 | } | ||
| 1232 | NotifyCallback(Outcome::PERMISSION_NOT_REVOKED); | ||
| 1233 | +#endif // BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1234 | } | ||
| 1235 | |||
| 1236 | void AbusiveOriginPermissionRevocationRequest::OnSafeBrowsingVerdictReceived( | ||
| 1237 | --- chrome/browser/permissions/contextual_notification_permission_ui_selector.cc.orig | ||
| 1238 | +++ chrome/browser/permissions/contextual_notification_permission_ui_selector.cc | ||
| 1239 | @@ -17,7 +17,6 @@ | ||
| 1240 | #include "chrome/browser/browser_process.h" | ||
| 1241 | #include "chrome/browser/permissions/quiet_notification_permission_ui_config.h" | ||
| 1242 | #include "chrome/browser/permissions/quiet_notification_permission_ui_state.h" | ||
| 1243 | -#include "chrome/browser/safe_browsing/safe_browsing_service.h" | ||
| 1244 | #include "chrome/common/chrome_features.h" | ||
| 1245 | #include "components/permissions/permission_request.h" | ||
| 1246 | #include "components/permissions/request_type.h" | ||
| 1247 | @@ -151,9 +150,6 @@ void ContextualNotificationPermissionUiS | ||
| 1248 | } | ||
| 1249 | |||
| 1250 | void ContextualNotificationPermissionUiSelector::Cancel() { | ||
| 1251 | - // The computation either finishes synchronously above, or is waiting on the | ||
| 1252 | - // Safe Browsing check. | ||
| 1253 | - safe_browsing_request_.reset(); | ||
| 1254 | } | ||
| 1255 | |||
| 1256 | bool ContextualNotificationPermissionUiSelector::IsPermissionRequestSupported( | ||
| 1257 | @@ -179,24 +175,14 @@ void ContextualNotificationPermissionUiS | ||
| 1258 | absl::optional<Decision> decision = | ||
| 1259 | GetDecisionBasedOnSiteReputation(reputation); | ||
| 1260 | |||
| 1261 | - // If the PreloadData suggests this is an unacceptable site, ping Safe | ||
| 1262 | - // Browsing to verify; but do not ping if it is not warranted. | ||
| 1263 | + // If the PreloadData suggests this is an unacceptable site, assume it is | ||
| 1264 | + // correct, since we can't access safe browsing. | ||
| 1265 | if (!decision || (!decision->quiet_ui_reason && !decision->warning_reason)) { | ||
| 1266 | Notify(Decision::UseNormalUiAndShowNoWarning()); | ||
| 1267 | - return; | ||
| 1268 | + } else { | ||
| 1269 | + // decision has a value, unwrap with .value() | ||
| 1270 | + Notify(decision.value()); | ||
| 1271 | } | ||
| 1272 | - | ||
| 1273 | - DCHECK(!safe_browsing_request_); | ||
| 1274 | - DCHECK(g_browser_process->safe_browsing_service()); | ||
| 1275 | - | ||
| 1276 | - // It is fine to use base::Unretained() here, as |safe_browsing_request_| | ||
| 1277 | - // guarantees not to fire the callback after its destruction. | ||
| 1278 | - safe_browsing_request_.emplace( | ||
| 1279 | - g_browser_process->safe_browsing_service()->database_manager(), | ||
| 1280 | - base::DefaultClock::GetInstance(), origin, | ||
| 1281 | - base::BindOnce(&ContextualNotificationPermissionUiSelector:: | ||
| 1282 | - OnSafeBrowsingVerdictReceived, | ||
| 1283 | - base::Unretained(this), *decision)); | ||
| 1284 | } | ||
| 1285 | |||
| 1286 | void ContextualNotificationPermissionUiSelector::OnSafeBrowsingVerdictReceived( | ||
| 1287 | --- chrome/browser/permissions/prediction_based_permission_ui_selector.cc.orig | ||
| 1288 | +++ chrome/browser/permissions/prediction_based_permission_ui_selector.cc | ||
| 1289 | @@ -212,10 +212,8 @@ bool PredictionBasedPermissionUiSelector | ||
| 1290 | permissions::RequestType request_type) { | ||
| 1291 | // We need to also check `kQuietNotificationPrompts` here since there is no | ||
| 1292 | // generic safeguard anywhere else in the stack. | ||
| 1293 | - if (!base::FeatureList::IsEnabled(features::kQuietNotificationPrompts) || | ||
| 1294 | - !safe_browsing::IsSafeBrowsingEnabled(*(profile_->GetPrefs()))) { | ||
| 1295 | + if (!base::FeatureList::IsEnabled(features::kQuietNotificationPrompts)) | ||
| 1296 | return false; | ||
| 1297 | - } | ||
| 1298 | double hold_back_chance = 0.0; | ||
| 1299 | bool is_permissions_predictions_enabled = false; | ||
| 1300 | switch (request_type) { | ||
| 1301 | --- chrome/browser/prefs/browser_prefs.cc.orig | ||
| 1302 | +++ chrome/browser/prefs/browser_prefs.cc | ||
| 1303 | @@ -243,7 +243,6 @@ | ||
| 1304 | #include "chrome/browser/nearby_sharing/common/nearby_share_prefs.h" | ||
| 1305 | #include "chrome/browser/new_tab_page/modules/drive/drive_service.h" | ||
| 1306 | #include "chrome/browser/new_tab_page/modules/photos/photos_service.h" | ||
| 1307 | -#include "chrome/browser/new_tab_page/modules/safe_browsing/safe_browsing_handler.h" | ||
| 1308 | #include "chrome/browser/new_tab_page/modules/task_module/task_module_service.h" | ||
| 1309 | #include "chrome/browser/new_tab_page/promos/promo_service.h" | ||
| 1310 | #include "chrome/browser/search/background/ntp_custom_background_service.h" | ||
| 1311 | @@ -1277,7 +1276,6 @@ void RegisterProfilePrefs(user_prefs::Pr | ||
| 1312 | NewTabPageHandler::RegisterProfilePrefs(registry); | ||
| 1313 | NewTabPageUI::RegisterProfilePrefs(registry); | ||
| 1314 | NewTabUI::RegisterProfilePrefs(registry); | ||
| 1315 | - ntp::SafeBrowsingHandler::RegisterProfilePrefs(registry); | ||
| 1316 | ntp_tiles::CustomLinksManagerImpl::RegisterProfilePrefs(registry); | ||
| 1317 | PhotosService::RegisterProfilePrefs(registry); | ||
| 1318 | PinnedTabCodec::RegisterProfilePrefs(registry); | ||
| 1319 | --- chrome/browser/reputation/reputation_service.cc.orig | ||
| 1320 | +++ chrome/browser/reputation/reputation_service.cc | ||
| 1321 | @@ -120,9 +120,7 @@ void ReputationService::GetReputationSta | ||
| 1322 | ReputationCheckCallback callback) { | ||
| 1323 | DCHECK(url.SchemeIsHTTPOrHTTPS()); | ||
| 1324 | |||
| 1325 | - bool has_delayed_warning = | ||
| 1326 | - !!safe_browsing::SafeBrowsingUserInteractionObserver::FromWebContents( | ||
| 1327 | - web_contents); | ||
| 1328 | + bool has_delayed_warning = false; | ||
| 1329 | |||
| 1330 | LookalikeUrlService* service = LookalikeUrlService::Get(profile_); | ||
| 1331 | if (service->EngagedSitesNeedUpdating()) { | ||
| 1332 | --- chrome/browser/safe_browsing/metrics/safe_browsing_metrics_provider.cc.orig | ||
| 1333 | +++ chrome/browser/safe_browsing/metrics/safe_browsing_metrics_provider.cc | ||
| 1334 | @@ -17,15 +17,6 @@ SafeBrowsingMetricsProvider::~SafeBrowsi | ||
| 1335 | |||
| 1336 | void SafeBrowsingMetricsProvider::ProvideCurrentSessionData( | ||
| 1337 | metrics::ChromeUserMetricsExtension* uma_proto) { | ||
| 1338 | - Profile* profile = cached_profile_.GetMetricsProfile(); | ||
| 1339 | - | ||
| 1340 | - if (!profile) | ||
| 1341 | - return; | ||
| 1342 | - | ||
| 1343 | - SafeBrowsingState state = GetSafeBrowsingState(*profile->GetPrefs()); | ||
| 1344 | - | ||
| 1345 | - base::UmaHistogramEnumeration( | ||
| 1346 | - "SafeBrowsing.Pref.MainProfile.SafeBrowsingState", state); | ||
| 1347 | } | ||
| 1348 | |||
| 1349 | } // namespace safe_browsing | ||
| 1350 | --- chrome/browser/safe_browsing/url_lookup_service_factory.cc.orig | ||
| 1351 | +++ chrome/browser/safe_browsing/url_lookup_service_factory.cc | ||
| 1352 | @@ -59,28 +59,7 @@ RealTimeUrlLookupServiceFactory::RealTim | ||
| 1353 | |||
| 1354 | KeyedService* RealTimeUrlLookupServiceFactory::BuildServiceInstanceFor( | ||
| 1355 | content::BrowserContext* context) const { | ||
| 1356 | - if (!g_browser_process->safe_browsing_service()) { | ||
| 1357 | - return nullptr; | ||
| 1358 | - } | ||
| 1359 | - Profile* profile = Profile::FromBrowserContext(context); | ||
| 1360 | - auto url_loader_factory = | ||
| 1361 | - std::make_unique<network::CrossThreadPendingSharedURLLoaderFactory>( | ||
| 1362 | - g_browser_process->safe_browsing_service()->GetURLLoaderFactory( | ||
| 1363 | - profile)); | ||
| 1364 | - return new RealTimeUrlLookupService( | ||
| 1365 | - network::SharedURLLoaderFactory::Create(std::move(url_loader_factory)), | ||
| 1366 | - VerdictCacheManagerFactory::GetForProfile(profile), | ||
| 1367 | - base::BindRepeating(&safe_browsing::GetUserPopulationForProfile, profile), | ||
| 1368 | - profile->GetPrefs(), | ||
| 1369 | - std::make_unique<SafeBrowsingPrimaryAccountTokenFetcher>( | ||
| 1370 | - IdentityManagerFactory::GetForProfile(profile)), | ||
| 1371 | - base::BindRepeating(&safe_browsing::SyncUtils:: | ||
| 1372 | - AreSigninAndSyncSetUpForSafeBrowsingTokenFetches, | ||
| 1373 | - SyncServiceFactory::GetForProfile(profile), | ||
| 1374 | - IdentityManagerFactory::GetForProfile(profile)), | ||
| 1375 | - profile->IsOffTheRecord(), g_browser_process->variations_service(), | ||
| 1376 | - SafeBrowsingNavigationObserverManagerFactory::GetForBrowserContext( | ||
| 1377 | - profile)); | ||
| 1378 | + return nullptr; | ||
| 1379 | } | ||
| 1380 | |||
| 1381 | } // namespace safe_browsing | ||
| 1382 | --- chrome/browser/ssl/chrome_security_blocking_page_factory.cc.orig | ||
| 1383 | +++ chrome/browser/ssl/chrome_security_blocking_page_factory.cc | ||
| 1384 | @@ -142,15 +142,6 @@ CreateSettingsPageHelper() { | ||
| 1385 | CreateChromeSettingsPageHelper(); | ||
| 1386 | } | ||
| 1387 | |||
| 1388 | -void LogSafeBrowsingSecuritySensitiveAction( | ||
| 1389 | - safe_browsing::SafeBrowsingMetricsCollector* metrics_collector) { | ||
| 1390 | - if (metrics_collector) { | ||
| 1391 | - metrics_collector->AddSafeBrowsingEventToPref( | ||
| 1392 | - safe_browsing::SafeBrowsingMetricsCollector::EventType:: | ||
| 1393 | - SECURITY_SENSITIVE_SSL_INTERSTITIAL); | ||
| 1394 | - } | ||
| 1395 | -} | ||
| 1396 | - | ||
| 1397 | } // namespace | ||
| 1398 | |||
| 1399 | std::unique_ptr<SSLBlockingPage> | ||
| 1400 | @@ -192,10 +183,6 @@ ChromeSecurityBlockingPageFactory::Creat | ||
| 1401 | } | ||
| 1402 | } | ||
| 1403 | |||
| 1404 | - LogSafeBrowsingSecuritySensitiveAction( | ||
| 1405 | - safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile( | ||
| 1406 | - Profile::FromBrowserContext(web_contents->GetBrowserContext()))); | ||
| 1407 | - | ||
| 1408 | auto controller_client = std::make_unique<SSLErrorControllerClient>( | ||
| 1409 | web_contents, ssl_info, cert_error, request_url, | ||
| 1410 | std::move(metrics_helper), CreateSettingsPageHelper()); | ||
| 1411 | @@ -264,10 +251,6 @@ ChromeSecurityBlockingPageFactory::Creat | ||
| 1412 | const GURL& request_url, | ||
| 1413 | std::unique_ptr<SSLCertReporter> ssl_cert_reporter, | ||
| 1414 | const net::SSLInfo& ssl_info) { | ||
| 1415 | - LogSafeBrowsingSecuritySensitiveAction( | ||
| 1416 | - safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile( | ||
| 1417 | - Profile::FromBrowserContext(web_contents->GetBrowserContext()))); | ||
| 1418 | - | ||
| 1419 | auto page = std::make_unique<LegacyTLSBlockingPage>( | ||
| 1420 | web_contents, cert_error, request_url, std::move(ssl_cert_reporter), | ||
| 1421 | /*can_show_enhanced_protection_message=*/true, ssl_info, | ||
| 1422 | @@ -289,10 +272,6 @@ ChromeSecurityBlockingPageFactory::Creat | ||
| 1423 | std::unique_ptr<SSLCertReporter> ssl_cert_reporter, | ||
| 1424 | const net::SSLInfo& ssl_info, | ||
| 1425 | const std::string& mitm_software_name) { | ||
| 1426 | - LogSafeBrowsingSecuritySensitiveAction( | ||
| 1427 | - safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile( | ||
| 1428 | - Profile::FromBrowserContext(web_contents->GetBrowserContext()))); | ||
| 1429 | - | ||
| 1430 | auto page = std::make_unique<MITMSoftwareBlockingPage>( | ||
| 1431 | web_contents, cert_error, request_url, std::move(ssl_cert_reporter), | ||
| 1432 | /*can_show_enhanced_protection_message=*/true, ssl_info, | ||
| 1433 | @@ -314,10 +293,6 @@ ChromeSecurityBlockingPageFactory::Creat | ||
| 1434 | const GURL& request_url, | ||
| 1435 | std::unique_ptr<SSLCertReporter> ssl_cert_reporter, | ||
| 1436 | const net::SSLInfo& ssl_info) { | ||
| 1437 | - LogSafeBrowsingSecuritySensitiveAction( | ||
| 1438 | - safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile( | ||
| 1439 | - Profile::FromBrowserContext(web_contents->GetBrowserContext()))); | ||
| 1440 | - | ||
| 1441 | auto page = std::make_unique<BlockedInterceptionBlockingPage>( | ||
| 1442 | web_contents, cert_error, request_url, std::move(ssl_cert_reporter), | ||
| 1443 | /*can_show_enhanced_protection_message=*/true, ssl_info, | ||
| 1444 | --- chrome/browser/ssl/sct_reporting_service_factory.cc.orig | ||
| 1445 | +++ chrome/browser/ssl/sct_reporting_service_factory.cc | ||
| 1446 | @@ -32,15 +32,7 @@ SCTReportingServiceFactory::~SCTReportin | ||
| 1447 | |||
| 1448 | KeyedService* SCTReportingServiceFactory::BuildServiceInstanceFor( | ||
| 1449 | content::BrowserContext* profile) const { | ||
| 1450 | - safe_browsing::SafeBrowsingService* safe_browsing_service = | ||
| 1451 | - g_browser_process->safe_browsing_service(); | ||
| 1452 | - // In unit tests the safe browsing service can be null, if this happens, | ||
| 1453 | - // return null instead of crashing. | ||
| 1454 | - if (!safe_browsing_service) | ||
| 1455 | - return nullptr; | ||
| 1456 | - | ||
| 1457 | - return new SCTReportingService(safe_browsing_service, | ||
| 1458 | - static_cast<Profile*>(profile)); | ||
| 1459 | + return nullptr; | ||
| 1460 | } | ||
| 1461 | |||
| 1462 | content::BrowserContext* SCTReportingServiceFactory::GetBrowserContextToUse( | ||
| 1463 | --- chrome/browser/subresource_filter/chrome_content_subresource_filter_web_contents_helper_factory.cc.orig | ||
| 1464 | +++ chrome/browser/subresource_filter/chrome_content_subresource_filter_web_contents_helper_factory.cc | ||
| 1465 | @@ -6,7 +6,6 @@ | ||
| 1466 | |||
| 1467 | #include "chrome/browser/browser_process.h" | ||
| 1468 | #include "chrome/browser/profiles/profile.h" | ||
| 1469 | -#include "chrome/browser/safe_browsing/safe_browsing_service.h" | ||
| 1470 | #include "chrome/browser/subresource_filter/subresource_filter_profile_context_factory.h" | ||
| 1471 | #include "components/safe_browsing/core/browser/db/database_manager.h" | ||
| 1472 | #include "components/subresource_filter/content/browser/content_subresource_filter_web_contents_helper.h" | ||
| 1473 | @@ -18,10 +17,7 @@ namespace { | ||
| 1474 | // available. Otherwise returns nullptr. | ||
| 1475 | const scoped_refptr<safe_browsing::SafeBrowsingDatabaseManager> | ||
| 1476 | GetDatabaseManagerFromSafeBrowsingService() { | ||
| 1477 | - safe_browsing::SafeBrowsingService* safe_browsing_service = | ||
| 1478 | - g_browser_process->safe_browsing_service(); | ||
| 1479 | - return safe_browsing_service ? safe_browsing_service->database_manager() | ||
| 1480 | - : nullptr; | ||
| 1481 | + return nullptr; | ||
| 1482 | } | ||
| 1483 | |||
| 1484 | } // namespace | ||
| 1485 | --- chrome/browser/ui/BUILD.gn.orig | ||
| 1486 | +++ chrome/browser/ui/BUILD.gn | ||
| 1487 | @@ -533,7 +533,6 @@ static_library("ui") { | ||
| 1488 | "//components/renderer_context_menu", | ||
| 1489 | "//components/resources", | ||
| 1490 | "//components/safe_browsing/content/browser", | ||
| 1491 | - "//components/safe_browsing/content/browser:client_side_detection", | ||
| 1492 | "//components/safe_browsing/content/browser/password_protection", | ||
| 1493 | "//components/safe_browsing/content/browser/web_ui", | ||
| 1494 | "//components/safe_browsing/core/browser/db:database_manager", | ||
| 1495 | --- chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc.orig | ||
| 1496 | +++ chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc | ||
| 1497 | @@ -16,6 +16,7 @@ | ||
| 1498 | #include "components/javascript_dialogs/tab_modal_dialog_manager.h" | ||
| 1499 | #include "components/javascript_dialogs/tab_modal_dialog_view.h" | ||
| 1500 | #include "components/navigation_metrics/navigation_metrics.h" | ||
| 1501 | +#include "components/safe_browsing/buildflags.h" | ||
| 1502 | #include "components/ukm/content/source_url_recorder.h" | ||
| 1503 | #include "content/public/browser/devtools_agent_host.h" | ||
| 1504 | #include "content/public/browser/navigation_handle.h" | ||
| 1505 | @@ -36,6 +37,7 @@ JavaScriptTabModalDialogManagerDelegateD | ||
| 1506 | |||
| 1507 | void JavaScriptTabModalDialogManagerDelegateDesktop::WillRunDialog() { | ||
| 1508 | BrowserList::AddObserver(this); | ||
| 1509 | + #if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1510 | // SafeBrowsing Delayed Warnings experiment can delay some SafeBrowsing | ||
| 1511 | // warnings until user interaction. If the current page has a delayed warning, | ||
| 1512 | // it'll have a user interaction observer attached. Show the warning | ||
| 1513 | @@ -46,6 +48,7 @@ void JavaScriptTabModalDialogManagerDele | ||
| 1514 | if (observer) { | ||
| 1515 | observer->OnJavaScriptDialog(); | ||
| 1516 | } | ||
| 1517 | + #endif // BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1518 | } | ||
| 1519 | |||
| 1520 | void JavaScriptTabModalDialogManagerDelegateDesktop::DidCloseDialog() { | ||
| 1521 | --- chrome/browser/ui/tab_contents/chrome_web_contents_view_handle_drop.cc.orig | ||
| 1522 | +++ chrome/browser/ui/tab_contents/chrome_web_contents_view_handle_drop.cc | ||
| 1523 | @@ -11,7 +11,10 @@ | ||
| 1524 | #include "base/task/post_task.h" | ||
| 1525 | #include "base/task/thread_pool.h" | ||
| 1526 | #include "base/task_runner_util.h" | ||
| 1527 | +#include "components/safe_browsing/buildflags.h" | ||
| 1528 | +#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1529 | #include "chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.h" | ||
| 1530 | +#endif | ||
| 1531 | #include "chrome/browser/profiles/profile.h" | ||
| 1532 | #include "chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.h" | ||
| 1533 | #include "content/public/browser/web_contents.h" | ||
| 1534 | @@ -22,6 +25,7 @@ | ||
| 1535 | |||
| 1536 | namespace { | ||
| 1537 | |||
| 1538 | +#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1539 | void CompletionCallback( | ||
| 1540 | content::WebContentsViewDelegate::DropCompletionCallback callback, | ||
| 1541 | const enterprise_connectors::ContentAnalysisDelegate::Data& data, | ||
| 1542 | @@ -63,6 +67,7 @@ enterprise_connectors::ContentAnalysisDe | ||
| 1543 | } | ||
| 1544 | return data; | ||
| 1545 | } | ||
| 1546 | +#endif // BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1547 | |||
| 1548 | // Helper class to handle WebContents being destroyed while files are opened in | ||
| 1549 | // the threadpool. This class deletes itself either when it's no longer needed | ||
| 1550 | @@ -76,6 +81,7 @@ class HandleDropScanData : public conten | ||
| 1551 | : content::WebContentsObserver(web_contents), | ||
| 1552 | callback_(std::move(callback)) {} | ||
| 1553 | |||
| 1554 | +#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1555 | void ScanData( | ||
| 1556 | enterprise_connectors::ContentAnalysisDelegate::Data analysis_data) { | ||
| 1557 | DCHECK(web_contents()); | ||
| 1558 | @@ -87,6 +93,7 @@ class HandleDropScanData : public conten | ||
| 1559 | |||
| 1560 | delete this; | ||
| 1561 | } | ||
| 1562 | +#endif // BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1563 | |||
| 1564 | void WebContentsDestroyed() override { delete this; } | ||
| 1565 | |||
| 1566 | @@ -106,13 +113,16 @@ void HandleOnPerformDrop( | ||
| 1567 | content::WebContents* web_contents, | ||
| 1568 | const content::DropData& drop_data, | ||
| 1569 | content::WebContentsViewDelegate::DropCompletionCallback callback) { | ||
| 1570 | +#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1571 | enterprise_connectors::ContentAnalysisDelegate::Data data; | ||
| 1572 | +#endif | ||
| 1573 | Profile* profile = | ||
| 1574 | Profile::FromBrowserContext(web_contents->GetBrowserContext()); | ||
| 1575 | auto connector = | ||
| 1576 | drop_data.filenames.empty() | ||
| 1577 | ? enterprise_connectors::AnalysisConnector::BULK_DATA_ENTRY | ||
| 1578 | : enterprise_connectors::AnalysisConnector::FILE_ATTACHED; | ||
| 1579 | +#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1580 | if (!enterprise_connectors::ContentAnalysisDelegate::IsEnabled( | ||
| 1581 | profile, web_contents->GetLastCommittedURL(), &data, connector)) { | ||
| 1582 | std::move(callback).Run( | ||
| 1583 | @@ -154,4 +164,8 @@ void HandleOnPerformDrop( | ||
| 1584 | std::move(callback).Run( | ||
| 1585 | content::WebContentsViewDelegate::DropCompletionResult::kContinue); | ||
| 1586 | } | ||
| 1587 | +#else | ||
| 1588 | + std::move(callback).Run( | ||
| 1589 | + content::WebContentsViewDelegate::DropCompletionResult::kContinue); | ||
| 1590 | +#endif // BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1591 | } | ||
| 1592 | --- chrome/browser/ui/views/download/download_item_view.cc.orig | ||
| 1593 | +++ chrome/browser/ui/views/download/download_item_view.cc | ||
| 1594 | @@ -837,9 +837,7 @@ void DownloadItemView::UpdateLabels() { | ||
| 1595 | deep_scanning_label_->SetVisible(mode_ == | ||
| 1596 | download::DownloadItemMode::kDeepScanning); | ||
| 1597 | if (deep_scanning_label_->GetVisible()) { | ||
| 1598 | - const int id = (model_->download() && | ||
| 1599 | - safe_browsing::DeepScanningRequest::ShouldUploadBinary( | ||
| 1600 | - model_->download())) | ||
| 1601 | + const int id = model_->download() | ||
| 1602 | ? IDS_PROMPT_DEEP_SCANNING_DOWNLOAD | ||
| 1603 | : IDS_PROMPT_DEEP_SCANNING_APP_DOWNLOAD; | ||
| 1604 | const std::u16string filename = ElidedFilename(*deep_scanning_label_); | ||
| 1605 | @@ -886,11 +884,15 @@ void DownloadItemView::UpdateButtons() { | ||
| 1606 | } | ||
| 1607 | |||
| 1608 | const bool allow_open_during_deep_scan = | ||
| 1609 | +#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1610 | (mode_ == download::DownloadItemMode::kDeepScanning) && | ||
| 1611 | !enterprise_connectors::ConnectorsServiceFactory::GetForBrowserContext( | ||
| 1612 | model_->profile()) | ||
| 1613 | ->DelayUntilVerdict( | ||
| 1614 | enterprise_connectors::AnalysisConnector::FILE_DOWNLOADED); | ||
| 1615 | +#else | ||
| 1616 | + false; | ||
| 1617 | +#endif // BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1618 | open_button_->SetEnabled((mode_ == download::DownloadItemMode::kNormal) || | ||
| 1619 | prompt_to_scan || allow_open_during_deep_scan); | ||
| 1620 | |||
| 1621 | @@ -1427,7 +1429,9 @@ void DownloadItemView::ShowContextMenuIm | ||
| 1622 | } | ||
| 1623 | |||
| 1624 | void DownloadItemView::OpenDownloadDuringAsyncScanning() { | ||
| 1625 | +#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1626 | model_->CompleteSafeBrowsingScan(); | ||
| 1627 | +#endif | ||
| 1628 | model_->SetOpenWhenComplete(true); | ||
| 1629 | } | ||
| 1630 | |||
| 1631 | --- chrome/browser/ui/webui/downloads/downloads_dom_handler.cc.orig | ||
| 1632 | +++ chrome/browser/ui/webui/downloads/downloads_dom_handler.cc | ||
| 1633 | @@ -366,7 +366,6 @@ void DownloadsDOMHandler::OpenDuringScan | ||
| 1634 | if (download) { | ||
| 1635 | DownloadItemModel model(download); | ||
| 1636 | model.SetOpenWhenComplete(true); | ||
| 1637 | - model.CompleteSafeBrowsingScan(); | ||
| 1638 | } | ||
| 1639 | } | ||
| 1640 | |||
| 1641 | --- chrome/browser/ui/webui/management/management_ui_handler.cc.orig | ||
| 1642 | +++ chrome/browser/ui/webui/management/management_ui_handler.cc | ||
| 1643 | @@ -805,12 +805,6 @@ base::Value ManagementUIHandler::GetThre | ||
| 1644 | &info); | ||
| 1645 | } | ||
| 1646 | |||
| 1647 | - if (connectors_service->GetAppliedRealTimeUrlCheck() != | ||
| 1648 | - safe_browsing::REAL_TIME_CHECK_DISABLED) { | ||
| 1649 | - AddThreatProtectionPermission(kManagementOnPageVisitedEvent, | ||
| 1650 | - kManagementOnPageVisitedVisibleData, &info); | ||
| 1651 | - } | ||
| 1652 | - | ||
| 1653 | const std::string enterprise_manager = | ||
| 1654 | connectors_service->GetManagementDomain(); | ||
| 1655 | |||
| 1656 | --- chrome/browser/webshare/share_service_impl.cc.orig | ||
| 1657 | +++ chrome/browser/webshare/share_service_impl.cc | ||
| 1658 | @@ -14,7 +14,9 @@ | ||
| 1659 | #include "chrome/browser/browser_process.h" | ||
| 1660 | #include "chrome/browser/safe_browsing/safe_browsing_service.h" | ||
| 1661 | #include "chrome/common/chrome_features.h" | ||
| 1662 | +#if BUILDFLAG(SAFE_BROWSING_AVAILABLE) | ||
| 1663 | #include "components/safe_browsing/content/common/file_type_policies.h" | ||
| 1664 | +#endif | ||
| 1665 | #include "components/safe_browsing/core/browser/db/database_manager.h" | ||
| 1666 | #include "content/public/browser/web_contents.h" | ||
| 1667 | #include "mojo/public/cpp/bindings/self_owned_receiver.h" | ||
| 1668 | @@ -182,11 +184,13 @@ void ShareServiceImpl::Share(const std:: | ||
| 1669 | // Check if at least one file is marked by the download protection service | ||
| 1670 | // to send a ping to check this file type. | ||
| 1671 | const base::FilePath path = base::FilePath::FromUTF8Unsafe(file->name); | ||
| 1672 | +#if BUILDFLAG(SAFE_BROWSING_AVAILABLE) | ||
| 1673 | if (!should_check_url && | ||
| 1674 | safe_browsing::FileTypePolicies::GetInstance()->IsCheckedBinaryFile( | ||
| 1675 | path)) { | ||
| 1676 | should_check_url = true; | ||
| 1677 | } | ||
| 1678 | +#endif // BUILDFLAG(SAFE_BROWSING_AVAILABLE) | ||
| 1679 | |||
| 1680 | // In the case where the original blob handle was to a native file (of | ||
| 1681 | // unknown size), the serialized data does not contain an accurate file | ||
| 1682 | @@ -196,6 +200,7 @@ void ShareServiceImpl::Share(const std:: | ||
| 1683 | } | ||
| 1684 | |||
| 1685 | DCHECK(!safe_browsing_request_); | ||
| 1686 | +#if BUILDFLAG(SAFE_BROWSING_AVAILABLE) | ||
| 1687 | if (should_check_url && g_browser_process->safe_browsing_service()) { | ||
| 1688 | safe_browsing_request_.emplace( | ||
| 1689 | g_browser_process->safe_browsing_service()->database_manager(), | ||
| 1690 | @@ -205,6 +210,7 @@ void ShareServiceImpl::Share(const std:: | ||
| 1691 | std::move(files), std::move(callback))); | ||
| 1692 | return; | ||
| 1693 | } | ||
| 1694 | +#endif // BUILDFLAG(SAFE_BROWSING_AVAILABLE) | ||
| 1695 | |||
| 1696 | OnSafeBrowsingResultReceived(title, text, share_url, std::move(files), | ||
| 1697 | std::move(callback), | ||
| 1698 | --- chrome/test/BUILD.gn.orig | ||
| 1699 | +++ chrome/test/BUILD.gn | ||
| 1700 | @@ -1196,7 +1196,6 @@ if (!is_android && !is_fuchsia) { | ||
| 1701 | "//components/resources", | ||
| 1702 | "//components/safe_browsing:buildflags", | ||
| 1703 | "//components/safe_browsing/content/browser", | ||
| 1704 | - "//components/safe_browsing/content/browser:client_side_detection", | ||
| 1705 | "//components/safe_browsing/content/browser:safe_browsing_service", | ||
| 1706 | "//components/safe_browsing/content/browser/password_protection", | ||
| 1707 | "//components/safe_browsing/content/browser/password_protection:test_support", | ||
| 1708 | @@ -5349,7 +5348,6 @@ test("unit_tests") { | ||
| 1709 | "//components/resources", | ||
| 1710 | "//components/safe_browsing:buildflags", | ||
| 1711 | "//components/safe_browsing/content/browser", | ||
| 1712 | - "//components/safe_browsing/content/browser:client_side_detection", | ||
| 1713 | "//components/safe_browsing/content/browser/password_protection", | ||
| 1714 | "//components/safe_browsing/content/browser/password_protection:mock_password_protection", | ||
| 1715 | "//components/safe_browsing/content/browser/web_ui", | ||
| 1716 | --- components/password_manager/content/browser/content_password_manager_driver.cc.orig | ||
| 1717 | +++ components/password_manager/content/browser/content_password_manager_driver.cc | ||
| 1718 | @@ -407,7 +407,7 @@ void ContentPasswordManagerDriver::Check | ||
| 1719 | if (client_->GetMetricsRecorder()) { | ||
| 1720 | client_->GetMetricsRecorder()->RecordUserFocusedPasswordField(); | ||
| 1721 | } | ||
| 1722 | -#if defined(ON_FOCUS_PING_ENABLED) | ||
| 1723 | +#if defined(ON_FOCUS_PING_ENABLED) && BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1724 | client_->CheckSafeBrowsingReputation(form_action, frame_url); | ||
| 1725 | #endif | ||
| 1726 | } | ||
| 1727 | --- components/password_manager/core/browser/password_manager_client.h.orig | ||
| 1728 | +++ components/password_manager/core/browser/password_manager_client.h | ||
| 1729 | @@ -339,11 +339,14 @@ class PasswordManagerClient { | ||
| 1730 | // Returns the current best guess as to the page's display language. | ||
| 1731 | virtual autofill::LanguageCode GetPageLanguage() const; | ||
| 1732 | |||
| 1733 | +#if (defined(ON_FOCUS_PING_ENABLED) || defined(PASSWORD_REUSE_DETECTION_ENABLED)) && \ | ||
| 1734 | + BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1735 | // Return the PasswordProtectionService associated with this instance. | ||
| 1736 | virtual safe_browsing::PasswordProtectionService* | ||
| 1737 | GetPasswordProtectionService() const = 0; | ||
| 1738 | +#endif | ||
| 1739 | |||
| 1740 | -#if defined(ON_FOCUS_PING_ENABLED) | ||
| 1741 | +#if defined(ON_FOCUS_PING_ENABLED) && BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 1742 | // Checks the safe browsing reputation of the webpage when the | ||
| 1743 | // user focuses on a username/password field. This is used for reporting | ||
| 1744 | // only, and won't trigger a warning. | ||
| 1745 | @@ -351,6 +354,7 @@ class PasswordManagerClient { | ||
| 1746 | const GURL& frame_url) = 0; | ||
| 1747 | #endif | ||
| 1748 | |||
| 1749 | +#if defined(PASSWORD_REUSE_DETECTION_ENABLED) | ||
| 1750 | // Checks the safe browsing reputation of the webpage where password reuse | ||
| 1751 | // happens. This is called by the PasswordReuseDetectionManager when a | ||
| 1752 | // protected password is typed on the wrong domain. This may trigger a | ||
| 1753 | @@ -363,6 +367,7 @@ class PasswordManagerClient { | ||
| 1754 | const std::string& username, | ||
| 1755 | const std::vector<MatchingReusedCredential>& matching_reused_credentials, | ||
| 1756 | bool password_field_exists) = 0; | ||
| 1757 | +#endif | ||
| 1758 | |||
| 1759 | // Records a Chrome Sync event that GAIA password reuse was detected. | ||
| 1760 | virtual void LogPasswordReuseDetectedEvent() = 0; | ||
| 1761 | --- components/password_manager/core/browser/password_reuse_detection_manager.cc.orig | ||
| 1762 | +++ components/password_manager/core/browser/password_reuse_detection_manager.cc | ||
| 1763 | @@ -161,9 +161,11 @@ void PasswordReuseDetectionManager::OnRe | ||
| 1764 | ? reused_protected_password_hash->username | ||
| 1765 | : ""; | ||
| 1766 | |||
| 1767 | + #if defined(PASSWORD_REUSE_DETECTION_ENABLED) | ||
| 1768 | client_->CheckProtectedPasswordEntry(reused_password_type, username, | ||
| 1769 | matching_reused_credentials, | ||
| 1770 | password_field_detected); | ||
| 1771 | + #endif | ||
| 1772 | } | ||
| 1773 | |||
| 1774 | void PasswordReuseDetectionManager::SetClockForTesting(base::Clock* clock) { | ||
| 1775 | --- components/safe_browsing/content/browser/BUILD.gn.orig | ||
| 1776 | +++ components/safe_browsing/content/browser/BUILD.gn | ||
| 1777 | @@ -82,8 +82,6 @@ source_set("browser") { | ||
| 1778 | "threat_details_cache.h", | ||
| 1779 | "threat_details_history.cc", | ||
| 1780 | "threat_details_history.h", | ||
| 1781 | - "user_population.cc", | ||
| 1782 | - "user_population.h", | ||
| 1783 | "web_api_handshake_checker.cc", | ||
| 1784 | "web_api_handshake_checker.h", | ||
| 1785 | ] | ||
| 1786 | --- components/safe_browsing/content/common/proto/BUILD.gn.orig | ||
| 1787 | +++ components/safe_browsing/content/common/proto/BUILD.gn | ||
| 1788 | @@ -5,8 +5,12 @@ | ||
| 1789 | import("//components/safe_browsing/buildflags.gni") | ||
| 1790 | import("//third_party/protobuf/proto_library.gni") | ||
| 1791 | |||
| 1792 | -if (safe_browsing_mode != 0) { | ||
| 1793 | +# Although this was gated on safe_browsing_mode != 0, a considerable amount | ||
| 1794 | +# of source code that relies on the types included in download_file_types.pb.h | ||
| 1795 | +# is not gated on BUILDFLAG(SAFE_BROWSING_AVAILABLE). This is far less | ||
| 1796 | +# invasive than the alternative. | ||
| 1797 | +# if (safe_browsing_mode != 0) { | ||
| 1798 | proto_library("download_file_types_proto") { | ||
| 1799 | sources = [ "download_file_types.proto" ] | ||
| 1800 | } | ||
| 1801 | -} | ||
| 1802 | +# } | ||
| 1803 | --- components/safe_browsing/content/common/safe_browsing.mojom.orig | ||
| 1804 | +++ components/safe_browsing/content/common/safe_browsing.mojom | ||
| 1805 | @@ -120,7 +120,6 @@ enum PhishingDetectorResult { | ||
| 1806 | INVALID_SCORE = 4, | ||
| 1807 | }; | ||
| 1808 | |||
| 1809 | -[EnableIf=full_safe_browsing] | ||
| 1810 | // Interface for setting the CSD model and to start phishing classification. | ||
| 1811 | interface PhishingDetector { | ||
| 1812 | // A classification model for client-side phishing detection. | ||
| 1813 | --- content/browser/file_system_access/safe_move_helper.cc.orig | ||
| 1814 | +++ content/browser/file_system_access/safe_move_helper.cc | ||
| 1815 | @@ -150,14 +150,8 @@ void SafeMoveHelper::Start(SafeMoveHelpe | ||
| 1816 | return; | ||
| 1817 | } | ||
| 1818 | |||
| 1819 | - if (!RequireSecurityChecks() || !manager_->permission_context()) { | ||
| 1820 | DidAfterWriteCheck( | ||
| 1821 | FileSystemAccessPermissionContext::AfterWriteCheckResult::kAllow); | ||
| 1822 | - return; | ||
| 1823 | - } | ||
| 1824 | - | ||
| 1825 | - ComputeHashForSourceFile(base::BindOnce(&SafeMoveHelper::DoAfterWriteCheck, | ||
| 1826 | - weak_factory_.GetWeakPtr())); | ||
| 1827 | } | ||
| 1828 | |||
| 1829 | void SafeMoveHelper::ComputeHashForSourceFile(HashCallback callback) { | ||
| 1830 | @@ -177,38 +171,6 @@ void SafeMoveHelper::ComputeHashForSourc | ||
| 1831 | std::move(wrapped_callback), source_url())); | ||
| 1832 | } | ||
| 1833 | |||
| 1834 | -void SafeMoveHelper::DoAfterWriteCheck(base::File::Error hash_result, | ||
| 1835 | - const std::string& hash, | ||
| 1836 | - int64_t size) { | ||
| 1837 | - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | ||
| 1838 | - | ||
| 1839 | - if (hash_result != base::File::FILE_OK) { | ||
| 1840 | - // Calculating the hash failed. | ||
| 1841 | - std::move(callback_).Run(file_system_access_error::FromStatus( | ||
| 1842 | - blink::mojom::FileSystemAccessStatus::kOperationAborted, | ||
| 1843 | - "Failed to perform Safe Browsing check.")); | ||
| 1844 | - return; | ||
| 1845 | - } | ||
| 1846 | - | ||
| 1847 | - if (!manager_) { | ||
| 1848 | - std::move(callback_).Run(file_system_access_error::FromStatus( | ||
| 1849 | - blink::mojom::FileSystemAccessStatus::kOperationAborted)); | ||
| 1850 | - return; | ||
| 1851 | - } | ||
| 1852 | - | ||
| 1853 | - auto item = std::make_unique<FileSystemAccessWriteItem>(); | ||
| 1854 | - item->target_file_path = dest_url().path(); | ||
| 1855 | - item->full_path = source_url().path(); | ||
| 1856 | - item->sha256_hash = hash; | ||
| 1857 | - item->size = size; | ||
| 1858 | - item->frame_url = context_.url; | ||
| 1859 | - item->has_user_gesture = has_transient_user_activation_; | ||
| 1860 | - manager_->permission_context()->PerformAfterWriteChecks( | ||
| 1861 | - std::move(item), context_.frame_id, | ||
| 1862 | - base::BindOnce(&SafeMoveHelper::DidAfterWriteCheck, | ||
| 1863 | - weak_factory_.GetWeakPtr())); | ||
| 1864 | -} | ||
| 1865 | - | ||
| 1866 | void SafeMoveHelper::DidAfterWriteCheck( | ||
| 1867 | FileSystemAccessPermissionContext::AfterWriteCheckResult result) { | ||
| 1868 | DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | ||
| 1869 | --- content/browser/file_system_access/safe_move_helper.h.orig | ||
| 1870 | +++ content/browser/file_system_access/safe_move_helper.h | ||
| 1871 | @@ -52,9 +52,6 @@ class CONTENT_EXPORT SafeMoveHelper { | ||
| 1872 | private: | ||
| 1873 | SEQUENCE_CHECKER(sequence_checker_); | ||
| 1874 | |||
| 1875 | - void DoAfterWriteCheck(base::File::Error hash_result, | ||
| 1876 | - const std::string& hash, | ||
| 1877 | - int64_t size); | ||
| 1878 | void DidAfterWriteCheck( | ||
| 1879 | FileSystemAccessPermissionContext::AfterWriteCheckResult result); | ||
| 1880 | void DidFileSkipQuarantine(base::File::Error result); | ||
| 1881 | --- content/public/browser/file_system_access_permission_context.h.orig | ||
| 1882 | +++ content/public/browser/file_system_access_permission_context.h | ||
| 1883 | @@ -107,12 +107,6 @@ class FileSystemAccessPermissionContext | ||
| 1884 | base::OnceCallback<void(SensitiveDirectoryResult)> callback) = 0; | ||
| 1885 | |||
| 1886 | enum class AfterWriteCheckResult { kAllow, kBlock }; | ||
| 1887 | - // Runs a recently finished write operation through checks such as malware | ||
| 1888 | - // or other security checks to determine if the write should be allowed. | ||
| 1889 | - virtual void PerformAfterWriteChecks( | ||
| 1890 | - std::unique_ptr<FileSystemAccessWriteItem> item, | ||
| 1891 | - GlobalRenderFrameHostId frame_id, | ||
| 1892 | - base::OnceCallback<void(AfterWriteCheckResult)> callback) = 0; | ||
| 1893 | |||
| 1894 | // Returns whether the give |origin| already allows read permission, or it is | ||
| 1895 | // possible to request one. This is used to block file dialogs from being | ||
| 1896 | --- extensions/browser/updater/update_service.cc.orig | ||
| 1897 | +++ extensions/browser/updater/update_service.cc | ||
| 1898 | @@ -111,13 +111,6 @@ void UpdateService::OnEvent(Events event | ||
| 1899 | break; | ||
| 1900 | } | ||
| 1901 | |||
| 1902 | - if (should_perform_action_on_omaha_attributes) { | ||
| 1903 | - base::Value attributes = GetExtensionOmahaAttributes(extension_id); | ||
| 1904 | - // Note that it's important to perform actions even if |attributes| is | ||
| 1905 | - // empty, missing values may default to false and have associated logic. | ||
| 1906 | - ExtensionSystem::Get(browser_context_) | ||
| 1907 | - ->PerformActionBasedOnOmahaAttributes(extension_id, attributes); | ||
| 1908 | - } | ||
| 1909 | } | ||
| 1910 | |||
| 1911 | UpdateService::UpdateService( | ||
| 1912 | --- weblayer/BUILD.gn.orig | ||
| 1913 | +++ weblayer/BUILD.gn | ||
| 1914 | @@ -463,7 +463,6 @@ source_set("weblayer_lib_base") { | ||
| 1915 | "//components/prefs", | ||
| 1916 | "//components/profile_metrics", | ||
| 1917 | "//components/safe_browsing/content/browser", | ||
| 1918 | - "//components/safe_browsing/content/browser:client_side_detection", | ||
| 1919 | "//components/safe_browsing/content/common:interfaces", | ||
| 1920 | "//components/safe_browsing/content/renderer:throttles", | ||
| 1921 | "//components/safe_browsing/content/renderer/phishing_classifier", | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/fix-learn-doubleclick-hsts.patch b/www/chromium-uc/patches/core/ungoogled-chromium/fix-learn-doubleclick-hsts.patch new file mode 100644 index 0000000..74d5b79 --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/fix-learn-doubleclick-hsts.patch | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | # Split up the learn.doubleclick.net string literal to prevent domain substitution breaking compilation due to the use of the excluded HSTS list json file in this code. | ||
| 2 | |||
| 3 | --- net/tools/transport_security_state_generator/transport_security_state_generator.cc.orig | ||
| 4 | +++ net/tools/transport_security_state_generator/transport_security_state_generator.cc | ||
| 5 | @@ -125,7 +125,7 @@ bool CheckDuplicateEntries(const Transpo | ||
| 6 | bool CheckNoopEntries(const TransportSecurityStateEntries& entries) { | ||
| 7 | for (const auto& entry : entries) { | ||
| 8 | if (!entry->force_https && entry->pinset.empty() && !entry->expect_ct) { | ||
| 9 | - if (entry->hostname == "learn.doubleclick.net") { | ||
| 10 | + if (entry->hostname == "learn.double" "click." "net") { | ||
| 11 | // This entry is deliberately used as an exclusion. | ||
| 12 | continue; | ||
| 13 | } | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/remove-unused-preferences-fields.patch b/www/chromium-uc/patches/core/ungoogled-chromium/remove-unused-preferences-fields.patch new file mode 100644 index 0000000..0527dde --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/remove-unused-preferences-fields.patch | |||
| @@ -0,0 +1,5260 @@ | |||
| 1 | # Remove unused Safe Browsing and Sign-in fields from Preferences file | ||
| 2 | # TODO: This patch should probably be split up and merged into | ||
| 3 | # disable-signin.patch and fix-building-without-safebrowsing.patch | ||
| 4 | |||
| 5 | --- android_webview/browser/aw_browser_context.cc.orig | ||
| 6 | +++ android_webview/browser/aw_browser_context.cc | ||
| 7 | @@ -49,7 +49,6 @@ | ||
| 8 | #include "components/prefs/pref_service_factory.h" | ||
| 9 | #include "components/prefs/segregated_pref_store.h" | ||
| 10 | #include "components/profile_metrics/browser_profile_type.h" | ||
| 11 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 12 | #include "components/url_formatter/url_fixer.h" | ||
| 13 | #include "components/user_prefs/user_prefs.h" | ||
| 14 | #include "components/visitedlink/browser/visitedlink_writer.h" | ||
| 15 | @@ -470,8 +469,6 @@ void AwBrowserContext::RebuildTable( | ||
| 16 | } | ||
| 17 | |||
| 18 | void AwBrowserContext::SetExtendedReportingAllowed(bool allowed) { | ||
| 19 | - user_pref_service_->SetBoolean( | ||
| 20 | - ::prefs::kSafeBrowsingExtendedReportingOptInAllowed, allowed); | ||
| 21 | } | ||
| 22 | |||
| 23 | // TODO(amalova): Make sure NetworkContextParams is configured correctly when | ||
| 24 | --- chrome/app/settings_strings.grdp.orig | ||
| 25 | +++ chrome/app/settings_strings.grdp | ||
| 26 | @@ -1591,78 +1591,9 @@ | ||
| 27 | <message name="IDS_SETTINGS_NETWORK_PREDICTION_ENABLED_DESC_COOKIES_PAGE" desc="On the cookies page, the secondary text next to the checkbox that enables prediction of network actions."> | ||
| 28 | Preloads pages that Chrome thinks you might visit. To do this, Chrome may use cookies, if you allow cookies, and may encrypt and send pages through Google to hide your identity from sites. | ||
| 29 | </message> | ||
| 30 | - <message name="IDS_SETTINGS_SAFEBROWSING_ENABLEPROTECTION" desc="The section title of 'Protects you and your device from dangerous sites'"> | ||
| 31 | - Safe Browsing (protects you and your device from dangerous sites) | ||
| 32 | - </message> | ||
| 33 | - <message name="IDS_SETTINGS_SAFEBROWSING_ENABLEPROTECTION_DESC" desc="Checkbox label: should Chrome protect user and user's device from dangerous sites"> | ||
| 34 | - Sends URLs of some pages you visit to Google, when your security is at risk | ||
| 35 | - </message> | ||
| 36 | - <message name="IDS_SETTINGS_SAFEBROWSING_ENABLE_REPORTING" desc="The section title of the extended safe browsing checkbox to help improve safe browsing"> | ||
| 37 | - Help improve Chrome security | ||
| 38 | - </message> | ||
| 39 | - <message name="IDS_SETTINGS_SAFEBROWSING_ENABLE_REPORTING_DESC" desc="Description for extended safe browsing"> | ||
| 40 | - Sends URLs of some pages you visit, limited system information, and some page content to Google, to help discover new threats and protect everyone on the web. | ||
| 41 | - </message> | ||
| 42 | <message name="IDS_SETTINGS_SAFEBROWSING_SECTION_LABEL" desc="The section label of the safe browsing section grouping safe browsing settings"> | ||
| 43 | Safe Browsing | ||
| 44 | </message> | ||
| 45 | - <message name="IDS_SETTINGS_SAFEBROWSING_ENHANCED" desc="Label for safe browsing enhanced protection mode"> | ||
| 46 | - Enhanced protection | ||
| 47 | - </message> | ||
| 48 | - <message name="IDS_SETTINGS_SAFEBROWSING_ENHANCED_DESC" desc="Description of safe browsing enhanced protection mode"> | ||
| 49 | - Faster, proactive protection against dangerous websites, downloads, and extensions. Warns you about password breaches. Requires browsing data to be sent to Google. | ||
| 50 | - </message> | ||
| 51 | - <message name="IDS_SETTINGS_SAFEBROWSING_ENHANCED_EXPAND_ACCESSIBILITY_LABEL" desc="Label for the button that toggles showing the detailed description of safe browsing enhanced protection. Only visible by screen reader software."> | ||
| 52 | - Show enhanced protection details | ||
| 53 | - </message> | ||
| 54 | - <message name="IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_ONE" desc="First bullet point under the safe browsing enhanced protection mode"> | ||
| 55 | - Predicts and warns you about dangerous events before they happen | ||
| 56 | - </message> | ||
| 57 | - <message name="IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_TWO" desc="Second bullet point under the safe browsing enhanced protection mode"> | ||
| 58 | - Keeps you safe on Chrome and may be used to improve your security in other Google apps when you are signed in | ||
| 59 | - </message> | ||
| 60 | - <message name="IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_THREE" desc="Third bullet point under the safe browsing enhanced protection mode"> | ||
| 61 | - Improves security for you and everyone on the web | ||
| 62 | - </message> | ||
| 63 | - <message name="IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_FOUR" desc="Fourth bullet point under the safe browsing enhanced protection mode"> | ||
| 64 | - Warns you if passwords are exposed in a data breach | ||
| 65 | - </message> | ||
| 66 | - <message name="IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_FIVE" desc="Fourth bullet point under the safe browsing enhanced protection mode"> | ||
| 67 | - Sends URLs to Safe Browsing to check them. Also sends a small sample of pages, downloads, extension activity, and system information to help discover new threats. Temporarily links this data to your Google Account when you're signed in, to protect you across Google apps. | ||
| 68 | - </message> | ||
| 69 | - <message name="IDS_SETTINGS_SAFEBROWSING_STANDARD" desc="Label for safe browsing standard protection mode"> | ||
| 70 | - Standard protection | ||
| 71 | - </message> | ||
| 72 | - <message name="IDS_SETTINGS_SAFEBROWSING_STANDARD_DESC" desc="Description for safe browsing standard protection mode"> | ||
| 73 | - Standard protection against websites, downloads, and extensions that are known to be dangerous. | ||
| 74 | - </message> | ||
| 75 | - <message name="IDS_SETTINGS_SAFEBROWSING_STANDARD_EXPAND_ACCESSIBILITY_LABEL" desc="Label for the button that toggles showing the detailed description of safe browsing standard protection. Only visible by screen reader software."> | ||
| 76 | - Show standard protection details | ||
| 77 | - </message> | ||
| 78 | - <message name="IDS_SETTINGS_SAFEBROWSING_STANDARD_BULLET_ONE" desc="First bullet point under the safe browsing standard protection mode"> | ||
| 79 | - Detects and warns you about dangerous events when they happen | ||
| 80 | - </message> | ||
| 81 | - <message name="IDS_SETTINGS_SAFEBROWSING_STANDARD_BULLET_TWO" desc="First bullet point under the safe browsing standard protection mode"> | ||
| 82 | - Checks URLs with a list of unsafe sites stored in Chrome. If a site tries to steal your password, or when you download a harmful file, Chrome may also send URLs, including bits of page content, to Safe Browsing. | ||
| 83 | - </message> | ||
| 84 | - <message name="IDS_SETTINGS_SAFEBROWSING_STANDARD_HELP_IMPROVE" desc="The name of the toggle to enable reporting to help improve safe browsing"> | ||
| 85 | - Help improve security on the web for everyone | ||
| 86 | - </message> | ||
| 87 | - <message name="IDS_SETTINGS_SAFEBROWSING_NONE" desc="Label for safe browsing no protection mode"> | ||
| 88 | - No protection (not recommended) | ||
| 89 | - </message> | ||
| 90 | - <message name="IDS_SETTINGS_SAFEBROWSING_NONE_DESC" desc="Description for safe browsing no protection mode"> | ||
| 91 | - Does not protect you against dangerous websites, downloads, and extensions. You’ll still get Safe Browsing protection, where available, in other Google services, like Gmail and Search. | ||
| 92 | - </message> | ||
| 93 | - <message name="IDS_SETTINGS_SAFEBROWSING_DISABLE_DIALOG_TITLE" desc="Title for the confirmation dialog to turn off SafeBrowsing"> | ||
| 94 | - Turn off Safe Browsing? | ||
| 95 | - </message> | ||
| 96 | - <message name="IDS_SETTINGS_SAFEBROWSING_DISABLE_DIALOG_DESC" desc="Description for the confirmation dialog to turn off SafeBrowsing"> | ||
| 97 | - Safe Browsing protects you against attackers who may trick you into doing something dangerous like installing malicious software or revealing personal information like passwords, phone numbers, or credit cards. If you turn it off, be careful when browsing unfamiliar or unreputable sites. | ||
| 98 | - </message> | ||
| 99 | - <message name="IDS_SETTINGS_SAFEBROWSING_DISABLE_DIALOG_CONFIRM" desc="Title for the confirmation dialog to turn off SafeBrowsing"> | ||
| 100 | - Turn off | ||
| 101 | - </message> | ||
| 102 | <message name="IDS_SETTINGS_ENABLE_DO_NOT_TRACK" desc="The label of the checkbox to enable/disable sending the 'Do Not track' header"> | ||
| 103 | Send a "Do Not Track" request with your browsing traffic | ||
| 104 | </message> | ||
| 105 | --- chrome/browser/android/signin/signin_manager_android.cc.orig | ||
| 106 | +++ chrome/browser/android/signin/signin_manager_android.cc | ||
| 107 | @@ -14,7 +14,6 @@ | ||
| 108 | #include "chrome/android/chrome_jni_headers/SigninManagerImpl_jni.h" | ||
| 109 | #include "chrome/common/pref_names.h" | ||
| 110 | #include "components/prefs/pref_service.h" | ||
| 111 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 112 | #include "google_apis/gaia/gaia_auth_util.h" | ||
| 113 | |||
| 114 | #include "base/android/callback_android.h" | ||
| 115 | @@ -30,7 +29,6 @@ | ||
| 116 | #include "components/policy/core/browser/browser_policy_connector.h" | ||
| 117 | #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" | ||
| 118 | #include "components/prefs/pref_service.h" | ||
| 119 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 120 | #include "components/signin/public/identity_manager/accounts_cookie_mutator.h" | ||
| 121 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 122 | #include "content/public/browser/browser_context.h" | ||
| 123 | @@ -95,8 +93,6 @@ class ProfileDataRemover : public conten | ||
| 124 | // All the Profile data has been wiped. Clear the last signed in username | ||
| 125 | // as well, so that the next signin doesn't trigger the account | ||
| 126 | // change dialog. | ||
| 127 | - profile_->GetPrefs()->ClearPref(prefs::kGoogleServicesLastAccountId); | ||
| 128 | - profile_->GetPrefs()->ClearPref(prefs::kGoogleServicesLastUsername); | ||
| 129 | } | ||
| 130 | |||
| 131 | origin_runner_->PostTask(FROM_HERE, std::move(callback_)); | ||
| 132 | @@ -132,11 +128,6 @@ SigninManagerAndroid::SigninManagerAndro | ||
| 133 | DCHECK(user_cloud_policy_manager_); | ||
| 134 | DCHECK(user_policy_signin_service_); | ||
| 135 | |||
| 136 | - signin_allowed_.Init( | ||
| 137 | - prefs::kSigninAllowed, profile_->GetPrefs(), | ||
| 138 | - base::BindRepeating(&SigninManagerAndroid::OnSigninAllowedPrefChanged, | ||
| 139 | - base::Unretained(this))); | ||
| 140 | - | ||
| 141 | force_browser_signin_.Init(prefs::kForceBrowserSignin, | ||
| 142 | g_browser_process->local_state()); | ||
| 143 | |||
| 144 | @@ -160,7 +151,7 @@ void SigninManagerAndroid::Shutdown() { | ||
| 145 | } | ||
| 146 | |||
| 147 | bool SigninManagerAndroid::IsSigninAllowed() const { | ||
| 148 | - return signin_allowed_.GetValue(); | ||
| 149 | + return false; | ||
| 150 | } | ||
| 151 | |||
| 152 | jboolean SigninManagerAndroid::IsSigninAllowedByPolicy(JNIEnv* env) const { | ||
| 153 | --- chrome/browser/android/signin/signin_manager_android.h.orig | ||
| 154 | +++ chrome/browser/android/signin/signin_manager_android.h | ||
| 155 | @@ -117,9 +117,6 @@ class SigninManagerAndroid : public Keye | ||
| 156 | |||
| 157 | Profile* const profile_ = nullptr; | ||
| 158 | |||
| 159 | - // Handler for prefs::kSigninAllowed set in user's profile. | ||
| 160 | - BooleanPrefMember signin_allowed_; | ||
| 161 | - | ||
| 162 | // Handler for prefs::kForceBrowserSignin. This preference is set in Local | ||
| 163 | // State, not in user prefs. | ||
| 164 | BooleanPrefMember force_browser_signin_; | ||
| 165 | --- chrome/browser/ash/lock_screen_apps/lock_screen_profile_creator_impl.cc.orig | ||
| 166 | +++ chrome/browser/ash/lock_screen_apps/lock_screen_profile_creator_impl.cc | ||
| 167 | @@ -18,7 +18,6 @@ | ||
| 168 | #include "chrome/browser/profiles/profile_manager.h" | ||
| 169 | #include "chrome/common/pref_names.h" | ||
| 170 | #include "components/prefs/pref_service.h" | ||
| 171 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 172 | #include "extensions/browser/extension_system.h" | ||
| 173 | |||
| 174 | namespace lock_screen_apps { | ||
| 175 | @@ -90,8 +89,6 @@ void LockScreenProfileCreatorImpl::OnPro | ||
| 176 | // SafeBrowsingService when the user has safe browsing disabled (reasoning | ||
| 177 | // similar to http://crbug.com/461493). | ||
| 178 | // TODO(tbarzic): Revisit this if webviews get enabled for lock screen apps. | ||
| 179 | - profile->GetPrefs()->SetBoolean(prefs::kSafeBrowsingEnabled, false); | ||
| 180 | - profile->GetPrefs()->SetBoolean(prefs::kSafeBrowsingEnhanced, false); | ||
| 181 | return; | ||
| 182 | } | ||
| 183 | |||
| 184 | --- chrome/browser/ash/lock_screen_apps/lock_screen_profile_creator_impl_unittest.cc.orig | ||
| 185 | +++ chrome/browser/ash/lock_screen_apps/lock_screen_profile_creator_impl_unittest.cc | ||
| 186 | @@ -37,7 +37,6 @@ | ||
| 187 | #include "components/arc/session/arc_session.h" | ||
| 188 | #include "components/crx_file/id_util.h" | ||
| 189 | #include "components/prefs/pref_service.h" | ||
| 190 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 191 | #include "content/public/test/browser_task_environment.h" | ||
| 192 | #include "extensions/common/extension.h" | ||
| 193 | #include "extensions/common/extension_builder.h" | ||
| 194 | --- chrome/browser/ash/login/signin/device_id_browsertest.cc.orig | ||
| 195 | +++ chrome/browser/ash/login/signin/device_id_browsertest.cc | ||
| 196 | @@ -24,7 +24,6 @@ | ||
| 197 | #include "chrome/common/chrome_switches.h" | ||
| 198 | #include "chrome/test/base/in_process_browser_test.h" | ||
| 199 | #include "components/prefs/pref_service.h" | ||
| 200 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 201 | #include "components/user_manager/known_user.h" | ||
| 202 | #include "components/user_manager/user_manager.h" | ||
| 203 | #include "content/public/test/browser_test.h" | ||
| 204 | @@ -249,15 +248,6 @@ IN_PROC_BROWSER_TEST_F(DeviceIDTest, PRE | ||
| 205 | SignInOnline(FakeGaiaMixin::kFakeUserEmail, FakeGaiaMixin::kFakeUserPassword, | ||
| 206 | kRefreshToken1, FakeGaiaMixin::kFakeUserGaiaId); | ||
| 207 | |||
| 208 | - // Simulate user that has device ID saved only in preferences (pre-M44). | ||
| 209 | - PrefService* prefs = | ||
| 210 | - ProfileHelper::Get() | ||
| 211 | - ->GetProfileByUser(user_manager::UserManager::Get()->GetActiveUser()) | ||
| 212 | - ->GetPrefs(); | ||
| 213 | - prefs->SetString( | ||
| 214 | - prefs::kGoogleServicesSigninScopedDeviceId, | ||
| 215 | - GetDeviceId(AccountId::FromUserEmail(FakeGaiaMixin::kFakeUserEmail))); | ||
| 216 | - | ||
| 217 | // Can't use SetKnownUserDeviceId here, because it forbids changing a device | ||
| 218 | // ID. | ||
| 219 | user_manager::known_user::SetStringPref( | ||
| 220 | @@ -282,13 +272,6 @@ IN_PROC_BROWSER_TEST_F(DeviceIDTest, PRE | ||
| 221 | SignInOnline(FakeGaiaMixin::kFakeUserEmail, FakeGaiaMixin::kFakeUserPassword, | ||
| 222 | kRefreshToken1, FakeGaiaMixin::kFakeUserGaiaId); | ||
| 223 | |||
| 224 | - PrefService* prefs = | ||
| 225 | - ProfileHelper::Get() | ||
| 226 | - ->GetProfileByUser(user_manager::UserManager::Get()->GetActiveUser()) | ||
| 227 | - ->GetPrefs(); | ||
| 228 | - EXPECT_TRUE( | ||
| 229 | - prefs->GetString(prefs::kGoogleServicesSigninScopedDeviceId).empty()); | ||
| 230 | - | ||
| 231 | // Can't use SetKnownUserDeviceId here, because it forbids changing a device | ||
| 232 | // ID. | ||
| 233 | user_manager::known_user::SetStringPref( | ||
| 234 | --- chrome/browser/chrome_content_browser_client.cc.orig | ||
| 235 | +++ chrome/browser/chrome_content_browser_client.cc | ||
| 236 | @@ -225,7 +225,6 @@ | ||
| 237 | #include "components/safe_browsing/core/browser/realtime/url_lookup_service.h" | ||
| 238 | #include "components/safe_browsing/core/browser/url_checker_delegate.h" | ||
| 239 | #include "components/safe_browsing/core/common/features.h" | ||
| 240 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 241 | #include "components/security_interstitials/content/insecure_form_navigation_throttle.h" | ||
| 242 | #include "components/security_interstitials/content/origin_policy_ui.h" | ||
| 243 | #include "components/security_interstitials/content/ssl_cert_reporter.h" | ||
| 244 | --- chrome/browser/download/download_browsertest.cc.orig | ||
| 245 | +++ chrome/browser/download/download_browsertest.cc | ||
| 246 | @@ -103,7 +103,6 @@ | ||
| 247 | #include "components/safe_browsing/content/browser/safe_browsing_service_interface.h" | ||
| 248 | #include "components/safe_browsing/content/common/proto/download_file_types.pb.h" | ||
| 249 | #include "components/safe_browsing/core/common/proto/csd.pb.h" | ||
| 250 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 251 | #include "components/security_state/core/features.h" | ||
| 252 | #include "components/security_state/core/security_state.h" | ||
| 253 | #include "components/services/quarantine/test_support.h" | ||
| 254 | --- chrome/browser/download/download_item_model.cc.orig | ||
| 255 | +++ chrome/browser/download/download_item_model.cc | ||
| 256 | @@ -783,6 +783,7 @@ void DownloadItemModel::ExecuteCommand(D | ||
| 257 | DownloadUIModel::ExecuteCommand(download_commands, command); | ||
| 258 | break; | ||
| 259 | case DownloadCommands::DEEP_SCAN: | ||
| 260 | +#if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 261 | safe_browsing::SafeBrowsingService* sb_service = | ||
| 262 | g_browser_process->safe_browsing_service(); | ||
| 263 | if (!sb_service) | ||
| 264 | @@ -808,6 +809,7 @@ void DownloadItemModel::ExecuteCommand(D | ||
| 265 | safe_browsing::DeepScanningRequest::DeepScanTrigger:: | ||
| 266 | TRIGGER_APP_PROMPT, | ||
| 267 | safe_browsing::DownloadCheckResult::UNKNOWN, std::move(settings)); | ||
| 268 | +#endif | ||
| 269 | break; | ||
| 270 | } | ||
| 271 | } | ||
| 272 | --- chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc.orig | ||
| 273 | +++ chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc | ||
| 274 | @@ -38,7 +38,6 @@ | ||
| 275 | #include "components/policy/core/common/chrome_schema.h" | ||
| 276 | #include "components/prefs/pref_service.h" | ||
| 277 | #include "components/safe_browsing/core/common/features.h" | ||
| 278 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 279 | #include "components/url_matcher/url_matcher.h" | ||
| 280 | #include "content/public/browser/web_contents.h" | ||
| 281 | #include "crypto/secure_hash.h" | ||
| 282 | --- chrome/browser/enterprise/connectors/connectors_manager.cc.orig | ||
| 283 | +++ chrome/browser/enterprise/connectors/connectors_manager.cc | ||
| 284 | @@ -6,6 +6,7 @@ | ||
| 285 | |||
| 286 | #include <memory> | ||
| 287 | |||
| 288 | +#include "base/bind.h" | ||
| 289 | #include "base/feature_list.h" | ||
| 290 | #include "base/no_destructor.h" | ||
| 291 | #include "base/values.h" | ||
| 292 | @@ -13,7 +14,6 @@ | ||
| 293 | #include "chrome/browser/enterprise/connectors/connectors_prefs.h" | ||
| 294 | #include "components/policy/core/browser/url_util.h" | ||
| 295 | #include "components/prefs/pref_service.h" | ||
| 296 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 297 | #include "components/url_matcher/url_matcher.h" | ||
| 298 | #include "url/gurl.h" | ||
| 299 | |||
| 300 | --- chrome/browser/enterprise/connectors/connectors_service.cc.orig | ||
| 301 | +++ chrome/browser/enterprise/connectors/connectors_service.cc | ||
| 302 | @@ -36,7 +36,6 @@ | ||
| 303 | #include "components/policy/core/common/cloud/machine_level_user_cloud_policy_store.h" | ||
| 304 | #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" | ||
| 305 | #include "components/policy/core/common/policy_types.h" | ||
| 306 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 307 | #include "components/signin/public/identity_manager/consent_level.h" | ||
| 308 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 309 | #include "components/user_prefs/user_prefs.h" | ||
| 310 | @@ -406,8 +405,7 @@ std::string ConnectorsService::GetManage | ||
| 311 | |||
| 312 | absl::optional<policy::PolicyScope> scope = absl::nullopt; | ||
| 313 | for (const char* scope_pref : | ||
| 314 | - {prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckScope, | ||
| 315 | - ConnectorScopePref(AnalysisConnector::FILE_ATTACHED), | ||
| 316 | + {ConnectorScopePref(AnalysisConnector::FILE_ATTACHED), | ||
| 317 | ConnectorScopePref(AnalysisConnector::FILE_DOWNLOADED), | ||
| 318 | ConnectorScopePref(AnalysisConnector::BULK_DATA_ENTRY), | ||
| 319 | ConnectorScopePref(ReportingConnector::SECURITY_EVENT)}) { | ||
| 320 | @@ -458,20 +456,6 @@ std::string ConnectorsService::GetManage | ||
| 321 | |||
| 322 | absl::optional<std::string> ConnectorsService::GetDMTokenForRealTimeUrlCheck() | ||
| 323 | const { | ||
| 324 | - if (!ConnectorsEnabled()) | ||
| 325 | - return absl::nullopt; | ||
| 326 | - | ||
| 327 | - if (Profile::FromBrowserContext(context_)->GetPrefs()->GetInteger( | ||
| 328 | - prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckMode) == | ||
| 329 | - safe_browsing::REAL_TIME_CHECK_DISABLED) { | ||
| 330 | - return absl::nullopt; | ||
| 331 | - } | ||
| 332 | - | ||
| 333 | - absl::optional<DmToken> dm_token = | ||
| 334 | - GetDmToken(prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckScope); | ||
| 335 | - | ||
| 336 | - if (dm_token.has_value()) | ||
| 337 | - return dm_token.value().value; | ||
| 338 | return absl::nullopt; | ||
| 339 | } | ||
| 340 | |||
| 341 | --- chrome/browser/enterprise/connectors/connectors_service.h.orig | ||
| 342 | +++ chrome/browser/enterprise/connectors/connectors_service.h | ||
| 343 | @@ -13,7 +13,6 @@ | ||
| 344 | #include "components/keyed_service/content/browser_context_keyed_service_factory.h" | ||
| 345 | #include "components/keyed_service/core/keyed_service.h" | ||
| 346 | #include "components/policy/core/common/policy_types.h" | ||
| 347 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 348 | #include "content/public/browser/browser_context.h" | ||
| 349 | |||
| 350 | namespace base { | ||
| 351 | --- chrome/browser/enterprise/signals/context_info_fetcher.cc.orig | ||
| 352 | +++ chrome/browser/enterprise/signals/context_info_fetcher.cc | ||
| 353 | @@ -183,11 +183,6 @@ void ContextInfoFetcher::Fetch(ContextIn | ||
| 354 | info.third_party_blocking_enabled = | ||
| 355 | utils::GetThirdPartyBlockingEnabled(g_browser_process->local_state()); | ||
| 356 | |||
| 357 | - Profile* profile = Profile::FromBrowserContext(browser_context_); | ||
| 358 | - info.safe_browsing_protection_level = | ||
| 359 | - utils::GetSafeBrowsingProtectionLevel(profile->GetPrefs()); | ||
| 360 | - info.password_protection_warning_trigger = | ||
| 361 | - utils::GetPasswordProtectionWarningTrigger(profile->GetPrefs()); | ||
| 362 | |||
| 363 | #if defined(OS_WIN) | ||
| 364 | base::ThreadPool::CreateCOMSTATaskRunner({base::MayBlock()}) | ||
| 365 | --- chrome/browser/enterprise/signals/context_info_fetcher.h.orig | ||
| 366 | +++ chrome/browser/enterprise/signals/context_info_fetcher.h | ||
| 367 | @@ -12,7 +12,6 @@ | ||
| 368 | #include "base/callback_forward.h" | ||
| 369 | #include "build/build_config.h" | ||
| 370 | #include "chrome/browser/enterprise/signals/signals_common.h" | ||
| 371 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 372 | |||
| 373 | namespace content { | ||
| 374 | class BrowserContext; | ||
| 375 | @@ -39,11 +38,8 @@ struct ContextInfo { | ||
| 376 | std::vector<std::string> on_bulk_data_entry_providers; | ||
| 377 | std::vector<std::string> on_security_event_providers; | ||
| 378 | std::string browser_version; | ||
| 379 | - safe_browsing::SafeBrowsingState safe_browsing_protection_level; | ||
| 380 | bool site_isolation_enabled; | ||
| 381 | bool built_in_dns_client_enabled; | ||
| 382 | - absl::optional<safe_browsing::PasswordProtectionTrigger> | ||
| 383 | - password_protection_warning_trigger; | ||
| 384 | absl::optional<bool> chrome_cleanup_enabled; | ||
| 385 | bool chrome_remote_desktop_app_blocked; | ||
| 386 | absl::optional<bool> third_party_blocking_enabled; | ||
| 387 | --- chrome/browser/enterprise/signals/signals_utils.cc.orig | ||
| 388 | +++ chrome/browser/enterprise/signals/signals_utils.cc | ||
| 389 | @@ -10,7 +10,6 @@ | ||
| 390 | #include "components/policy/content/policy_blocklist_service.h" | ||
| 391 | #include "components/policy/core/browser/url_blocklist_manager.h" | ||
| 392 | #include "components/prefs/pref_service.h" | ||
| 393 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 394 | |||
| 395 | #if defined(OS_WIN) | ||
| 396 | #include "components/component_updater/pref_names.h" | ||
| 397 | --- chrome/browser/enterprise/signals/signals_utils.h.orig | ||
| 398 | +++ chrome/browser/enterprise/signals/signals_utils.h | ||
| 399 | @@ -5,8 +5,6 @@ | ||
| 400 | #ifndef CHROME_BROWSER_ENTERPRISE_SIGNALS_SIGNALS_UTILS_H_ | ||
| 401 | #define CHROME_BROWSER_ENTERPRISE_SIGNALS_SIGNALS_UTILS_H_ | ||
| 402 | |||
| 403 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 404 | - | ||
| 405 | #include "third_party/abseil-cpp/absl/types/optional.h" | ||
| 406 | |||
| 407 | class PolicyBlocklistService; | ||
| 408 | --- chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc.orig | ||
| 409 | +++ chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc | ||
| 410 | @@ -77,45 +77,10 @@ api::enterprise_reporting_private::Conte | ||
| 411 | info.browser_version = std::move(signals.browser_version); | ||
| 412 | info.built_in_dns_client_enabled = signals.built_in_dns_client_enabled; | ||
| 413 | |||
| 414 | - switch (signals.safe_browsing_protection_level) { | ||
| 415 | - case safe_browsing::SafeBrowsingState::NO_SAFE_BROWSING: | ||
| 416 | - info.safe_browsing_protection_level = extensions::api:: | ||
| 417 | - enterprise_reporting_private::SAFE_BROWSING_LEVEL_DISABLED; | ||
| 418 | - break; | ||
| 419 | - case safe_browsing::SafeBrowsingState::STANDARD_PROTECTION: | ||
| 420 | - info.safe_browsing_protection_level = extensions::api:: | ||
| 421 | - enterprise_reporting_private::SAFE_BROWSING_LEVEL_STANDARD; | ||
| 422 | - break; | ||
| 423 | - case safe_browsing::SafeBrowsingState::ENHANCED_PROTECTION: | ||
| 424 | - info.safe_browsing_protection_level = extensions::api:: | ||
| 425 | - enterprise_reporting_private::SAFE_BROWSING_LEVEL_ENHANCED; | ||
| 426 | - break; | ||
| 427 | - } | ||
| 428 | - if (!signals.password_protection_warning_trigger.has_value()) { | ||
| 429 | - info.password_protection_warning_trigger = extensions::api:: | ||
| 430 | - enterprise_reporting_private::PASSWORD_PROTECTION_TRIGGER_POLICY_UNSET; | ||
| 431 | - } else { | ||
| 432 | - switch (signals.password_protection_warning_trigger.value()) { | ||
| 433 | - case safe_browsing::PASSWORD_PROTECTION_OFF: | ||
| 434 | - info.password_protection_warning_trigger = | ||
| 435 | - extensions::api::enterprise_reporting_private:: | ||
| 436 | - PASSWORD_PROTECTION_TRIGGER_PASSWORD_PROTECTION_OFF; | ||
| 437 | - break; | ||
| 438 | - case safe_browsing::PASSWORD_REUSE: | ||
| 439 | - info.password_protection_warning_trigger = | ||
| 440 | - extensions::api::enterprise_reporting_private:: | ||
| 441 | - PASSWORD_PROTECTION_TRIGGER_PASSWORD_REUSE; | ||
| 442 | - break; | ||
| 443 | - case safe_browsing::PHISHING_REUSE: | ||
| 444 | - info.password_protection_warning_trigger = | ||
| 445 | - extensions::api::enterprise_reporting_private:: | ||
| 446 | - PASSWORD_PROTECTION_TRIGGER_PHISHING_REUSE; | ||
| 447 | - break; | ||
| 448 | - case safe_browsing::PASSWORD_PROTECTION_TRIGGER_MAX: | ||
| 449 | - NOTREACHED(); | ||
| 450 | - break; | ||
| 451 | - } | ||
| 452 | - } | ||
| 453 | + info.safe_browsing_protection_level = extensions::api:: | ||
| 454 | + enterprise_reporting_private::SAFE_BROWSING_LEVEL_DISABLED; | ||
| 455 | + info.password_protection_warning_trigger = extensions::api:: | ||
| 456 | + enterprise_reporting_private::PASSWORD_PROTECTION_TRIGGER_POLICY_UNSET; | ||
| 457 | |||
| 458 | return info; | ||
| 459 | } | ||
| 460 | --- chrome/browser/extensions/api/identity/identity_apitest.cc.orig | ||
| 461 | +++ chrome/browser/extensions/api/identity/identity_apitest.cc | ||
| 462 | @@ -56,7 +56,6 @@ | ||
| 463 | #include "components/prefs/pref_service.h" | ||
| 464 | #include "components/signin/core/browser/account_reconcilor.h" | ||
| 465 | #include "components/signin/public/base/list_accounts_test_utils.h" | ||
| 466 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 467 | #include "components/signin/public/base/signin_switches.h" | ||
| 468 | #include "components/signin/public/identity_manager/accounts_mutator.h" | ||
| 469 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 470 | --- chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc.orig | ||
| 471 | +++ chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc | ||
| 472 | @@ -30,7 +30,6 @@ | ||
| 473 | #include "chrome/common/channel_info.h" | ||
| 474 | #include "chrome/common/extensions/api/identity.h" | ||
| 475 | #include "components/prefs/pref_service.h" | ||
| 476 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 477 | #include "components/signin/public/base/signin_switches.h" | ||
| 478 | #include "components/signin/public/identity_manager/access_token_info.h" | ||
| 479 | #include "components/signin/public/identity_manager/accounts_in_cookie_jar_info.h" | ||
| 480 | @@ -64,7 +63,7 @@ const char* const kExtensionsIdentityAPI | ||
| 481 | "extensions_identity_api"; | ||
| 482 | |||
| 483 | bool IsBrowserSigninAllowed(Profile* profile) { | ||
| 484 | - return profile->GetPrefs()->GetBoolean(prefs::kSigninAllowed); | ||
| 485 | + return false; | ||
| 486 | } | ||
| 487 | |||
| 488 | std::string GetOAuth2MintTokenFlowVersion() { | ||
| 489 | --- chrome/browser/extensions/api/preference/preference_api.cc.orig | ||
| 490 | +++ chrome/browser/extensions/api/preference/preference_api.cc | ||
| 491 | @@ -35,7 +35,6 @@ | ||
| 492 | #include "components/prefs/pref_service.h" | ||
| 493 | #include "components/privacy_sandbox/privacy_sandbox_prefs.h" | ||
| 494 | #include "components/proxy_config/proxy_config_pref_names.h" | ||
| 495 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 496 | #include "components/spellcheck/browser/pref_names.h" | ||
| 497 | #include "components/translate/core/browser/translate_pref_names.h" | ||
| 498 | #include "extensions/browser/extension_pref_value_map.h" | ||
| 499 | @@ -109,11 +108,6 @@ const PrefMappingEntry kPrefMapping[] = | ||
| 500 | APIPermissionID::kPrivacy}, | ||
| 501 | {"doNotTrackEnabled", prefs::kEnableDoNotTrack, APIPermissionID::kPrivacy, | ||
| 502 | APIPermissionID::kPrivacy}, | ||
| 503 | - {"safeBrowsingEnabled", prefs::kSafeBrowsingEnabled, | ||
| 504 | - APIPermissionID::kPrivacy, APIPermissionID::kPrivacy}, | ||
| 505 | - {"safeBrowsingExtendedReportingEnabled", | ||
| 506 | - prefs::kSafeBrowsingScoutReportingEnabled, APIPermissionID::kPrivacy, | ||
| 507 | - APIPermissionID::kPrivacy}, | ||
| 508 | {"searchSuggestEnabled", prefs::kSearchSuggestEnabled, | ||
| 509 | APIPermissionID::kPrivacy, APIPermissionID::kPrivacy}, | ||
| 510 | {"spellingServiceEnabled", spellcheck::prefs::kSpellCheckUseSpellingService, | ||
| 511 | @@ -844,18 +838,6 @@ ExtensionFunction::ResponseAction SetPre | ||
| 512 | base::Value(browser_pref_value->GetBool())); | ||
| 513 | } | ||
| 514 | |||
| 515 | - // Whenever an extension takes control of the |kSafeBrowsingEnabled| | ||
| 516 | - // preference, it must also set |kSafeBrowsingEnhanced| to false. | ||
| 517 | - // See crbug.com/1064722 for more background. | ||
| 518 | - // | ||
| 519 | - // TODO(crbug.com/1064722): Consider extending | ||
| 520 | - // chrome.privacy.services.safeBrowsingEnabled to a three-state enum. | ||
| 521 | - if (prefs::kSafeBrowsingEnabled == browser_pref) { | ||
| 522 | - preference_api->SetExtensionControlledPref(extension_id(), | ||
| 523 | - prefs::kSafeBrowsingEnhanced, | ||
| 524 | - scope, base::Value(false)); | ||
| 525 | - } | ||
| 526 | - | ||
| 527 | preference_api->SetExtensionControlledPref( | ||
| 528 | extension_id(), browser_pref, scope, | ||
| 529 | base::Value::FromUniquePtrValue(std::move(browser_pref_value))); | ||
| 530 | @@ -908,18 +890,6 @@ ExtensionFunction::ResponseAction ClearP | ||
| 531 | PreferenceAPI::Get(browser_context()) | ||
| 532 | ->RemoveExtensionControlledPref(extension_id(), browser_pref, scope); | ||
| 533 | |||
| 534 | - // Whenever an extension clears the |kSafeBrowsingEnabled| preference, | ||
| 535 | - // it must also clear |kSafeBrowsingEnhanced|. See crbug.com/1064722 for | ||
| 536 | - // more background. | ||
| 537 | - // | ||
| 538 | - // TODO(crbug.com/1064722): Consider extending | ||
| 539 | - // chrome.privacy.services.safeBrowsingEnabled to a three-state enum. | ||
| 540 | - if (prefs::kSafeBrowsingEnabled == browser_pref) { | ||
| 541 | - PreferenceAPI::Get(browser_context()) | ||
| 542 | - ->RemoveExtensionControlledPref(extension_id(), | ||
| 543 | - prefs::kSafeBrowsingEnhanced, scope); | ||
| 544 | - } | ||
| 545 | - | ||
| 546 | return RespondNow(NoArguments()); | ||
| 547 | } | ||
| 548 | |||
| 549 | --- chrome/browser/extensions/api/preference/preference_apitest.cc.orig | ||
| 550 | +++ chrome/browser/extensions/api/preference/preference_apitest.cc | ||
| 551 | @@ -28,7 +28,6 @@ | ||
| 552 | #include "components/keep_alive_registry/scoped_keep_alive.h" | ||
| 553 | #include "components/password_manager/core/common/password_manager_pref_names.h" | ||
| 554 | #include "components/prefs/pref_service.h" | ||
| 555 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 556 | #include "components/translate/core/browser/translate_pref_names.h" | ||
| 557 | #include "content/public/browser/notification_service.h" | ||
| 558 | #include "content/public/test/browser_test.h" | ||
| 559 | @@ -73,7 +72,6 @@ class ExtensionPreferenceApiTest : publi | ||
| 560 | prefs->GetInteger(prefs::kNetworkPredictionOptions)); | ||
| 561 | EXPECT_TRUE( | ||
| 562 | prefs->GetBoolean(password_manager::prefs::kCredentialsEnableService)); | ||
| 563 | - EXPECT_TRUE(prefs->GetBoolean(prefs::kSafeBrowsingEnabled)); | ||
| 564 | EXPECT_TRUE(prefs->GetBoolean(prefs::kSearchSuggestEnabled)); | ||
| 565 | } | ||
| 566 | |||
| 567 | @@ -99,7 +97,6 @@ class ExtensionPreferenceApiTest : publi | ||
| 568 | prefs->GetInteger(prefs::kNetworkPredictionOptions)); | ||
| 569 | EXPECT_FALSE( | ||
| 570 | prefs->GetBoolean(password_manager::prefs::kCredentialsEnableService)); | ||
| 571 | - EXPECT_FALSE(prefs->GetBoolean(prefs::kSafeBrowsingEnabled)); | ||
| 572 | EXPECT_FALSE(prefs->GetBoolean(prefs::kSearchSuggestEnabled)); | ||
| 573 | } | ||
| 574 | |||
| 575 | @@ -163,7 +160,6 @@ IN_PROC_BROWSER_TEST_F(ExtensionPreferen | ||
| 576 | prefs->SetInteger(prefs::kNetworkPredictionOptions, | ||
| 577 | chrome_browser_net::NETWORK_PREDICTION_NEVER); | ||
| 578 | prefs->SetBoolean(password_manager::prefs::kCredentialsEnableService, false); | ||
| 579 | - prefs->SetBoolean(prefs::kSafeBrowsingEnabled, false); | ||
| 580 | prefs->SetBoolean(prefs::kSearchSuggestEnabled, false); | ||
| 581 | prefs->SetString(prefs::kWebRTCIPHandlingPolicy, | ||
| 582 | blink::kWebRTCIPHandlingDefaultPublicInterfaceOnly); | ||
| 583 | --- chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc.orig | ||
| 584 | +++ chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc | ||
| 585 | @@ -36,7 +36,6 @@ | ||
| 586 | #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" | ||
| 587 | #include "components/prefs/pref_service.h" | ||
| 588 | #include "components/safe_browsing/content/browser/web_ui/safe_browsing_ui.h" | ||
| 589 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 590 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 591 | #include "content/public/browser/browser_context.h" | ||
| 592 | #include "extensions/browser/event_router.h" | ||
| 593 | --- chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router_unittest.cc.orig | ||
| 594 | +++ chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router_unittest.cc | ||
| 595 | @@ -35,7 +35,6 @@ | ||
| 596 | #include "components/policy/core/common/cloud/mock_cloud_policy_client.h" | ||
| 597 | #include "components/policy/core/common/cloud/realtime_reporting_job_configuration.h" | ||
| 598 | #include "components/safe_browsing/core/common/features.h" | ||
| 599 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 600 | #include "components/signin/public/identity_manager/identity_test_environment.h" | ||
| 601 | #include "content/public/test/browser_task_environment.h" | ||
| 602 | #include "extensions/browser/test_event_router.h" | ||
| 603 | --- chrome/browser/extensions/api/settings_private/prefs_util.cc.orig | ||
| 604 | +++ chrome/browser/extensions/api/settings_private/prefs_util.cc | ||
| 605 | @@ -43,7 +43,6 @@ | ||
| 606 | #include "components/prefs/pref_service.h" | ||
| 607 | #include "components/privacy_sandbox/privacy_sandbox_prefs.h" | ||
| 608 | #include "components/proxy_config/proxy_config_pref_names.h" | ||
| 609 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 610 | #include "components/search_engines/default_search_manager.h" | ||
| 611 | #include "components/spellcheck/browser/pref_names.h" | ||
| 612 | #include "components/translate/core/browser/translate_pref_names.h" | ||
| 613 | @@ -283,16 +282,6 @@ const PrefsUtil::TypedPrefMap& PrefsUtil | ||
| 614 | settings_api::PrefType::PREF_TYPE_BOOLEAN; | ||
| 615 | |||
| 616 | // Security page | ||
| 617 | - (*s_allowlist)[::kGeneratedPasswordLeakDetectionPref] = | ||
| 618 | - settings_api::PrefType::PREF_TYPE_BOOLEAN; | ||
| 619 | - (*s_allowlist)[::prefs::kSafeBrowsingEnabled] = | ||
| 620 | - settings_api::PrefType::PREF_TYPE_BOOLEAN; | ||
| 621 | - (*s_allowlist)[::prefs::kSafeBrowsingEnhanced] = | ||
| 622 | - settings_api::PrefType::PREF_TYPE_BOOLEAN; | ||
| 623 | - (*s_allowlist)[::prefs::kSafeBrowsingScoutReportingEnabled] = | ||
| 624 | - settings_api::PrefType::PREF_TYPE_BOOLEAN; | ||
| 625 | - (*s_allowlist)[::safe_browsing::kGeneratedSafeBrowsingPref] = | ||
| 626 | - settings_api::PrefType::PREF_TYPE_NUMBER; | ||
| 627 | (*s_allowlist)[::prefs::kHttpsOnlyModeEnabled] = | ||
| 628 | settings_api::PrefType::PREF_TYPE_BOOLEAN; | ||
| 629 | |||
| 630 | --- chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc.orig | ||
| 631 | +++ chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc | ||
| 632 | @@ -647,9 +647,6 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebstore | ||
| 633 | IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateGetReferrerChainApiTest, | ||
| 634 | GetReferrerChainForNonSafeBrowsingUser) { | ||
| 635 | PrefService* pref_service = browser()->profile()->GetPrefs(); | ||
| 636 | - EXPECT_TRUE(pref_service->GetBoolean(prefs::kSafeBrowsingEnabled)); | ||
| 637 | - // Disable SafeBrowsing. | ||
| 638 | - pref_service->SetBoolean(prefs::kSafeBrowsingEnabled, false); | ||
| 639 | |||
| 640 | GURL page_url = GetTestServerURLWithReferrers("empty_referrer_chain.html"); | ||
| 641 | ASSERT_TRUE(OpenTestURL(page_url)); | ||
| 642 | --- chrome/browser/extensions/extension_allowlist.cc.orig | ||
| 643 | +++ chrome/browser/extensions/extension_allowlist.cc | ||
| 644 | @@ -9,7 +9,6 @@ | ||
| 645 | #include "chrome/browser/profiles/profile.h" | ||
| 646 | #include "chrome/browser/safe_browsing/safe_browsing_metrics_collector_factory.h" | ||
| 647 | #include "components/safe_browsing/core/browser/safe_browsing_metrics_collector.h" | ||
| 648 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 649 | #include "extensions/browser/allowlist_state.h" | ||
| 650 | #include "extensions/browser/extension_registry.h" | ||
| 651 | #include "extensions/browser/extension_system.h" | ||
| 652 | @@ -68,10 +67,6 @@ ExtensionAllowlist::ExtensionAllowlist(P | ||
| 653 | // Register to Enhanced Safe Browsing setting changes for allowlist | ||
| 654 | // enforcements. | ||
| 655 | pref_change_registrar_.Init(profile_->GetPrefs()); | ||
| 656 | - pref_change_registrar_.Add( | ||
| 657 | - prefs::kSafeBrowsingEnhanced, | ||
| 658 | - base::BindRepeating(&ExtensionAllowlist::OnSafeBrowsingEnhancedChanged, | ||
| 659 | - base::Unretained(this))); | ||
| 660 | } | ||
| 661 | |||
| 662 | ExtensionAllowlist::~ExtensionAllowlist() = default; | ||
| 663 | @@ -240,15 +235,8 @@ void ExtensionAllowlist::OnExtensionInst | ||
| 664 | } | ||
| 665 | |||
| 666 | void ExtensionAllowlist::SetAllowlistEnforcementFields() { | ||
| 667 | - if (safe_browsing::IsEnhancedProtectionEnabled(*profile_->GetPrefs())) { | ||
| 668 | - warnings_enabled_ = base::FeatureList::IsEnabled( | ||
| 669 | - extensions_features::kSafeBrowsingCrxAllowlistShowWarnings); | ||
| 670 | - should_auto_disable_extensions_ = base::FeatureList::IsEnabled( | ||
| 671 | - extensions_features::kSafeBrowsingCrxAllowlistAutoDisable); | ||
| 672 | - } else { | ||
| 673 | warnings_enabled_ = false; | ||
| 674 | should_auto_disable_extensions_ = false; | ||
| 675 | - } | ||
| 676 | } | ||
| 677 | |||
| 678 | // `ApplyEnforcement` can be called when an extension becomes not allowlisted or | ||
| 679 | @@ -398,15 +386,6 @@ void ExtensionAllowlist::NotifyExtension | ||
| 680 | } | ||
| 681 | |||
| 682 | void ExtensionAllowlist::ReportExtensionReEnabledEvent() { | ||
| 683 | - auto* metrics_collector = | ||
| 684 | - safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile( | ||
| 685 | - profile_); | ||
| 686 | - DCHECK(metrics_collector); | ||
| 687 | - if (metrics_collector) { | ||
| 688 | - metrics_collector->AddSafeBrowsingEventToPref( | ||
| 689 | - safe_browsing::SafeBrowsingMetricsCollector::EventType:: | ||
| 690 | - NON_ALLOWLISTED_EXTENSION_RE_ENABLED); | ||
| 691 | - } | ||
| 692 | } | ||
| 693 | |||
| 694 | } // namespace extensions | ||
| 695 | --- chrome/browser/extensions/installed_loader.cc.orig | ||
| 696 | +++ chrome/browser/extensions/installed_loader.cc | ||
| 697 | @@ -797,12 +797,6 @@ void InstalledLoader::RecordExtensionsMe | ||
| 698 | enabled_not_allowlisted_count); | ||
| 699 | base::UmaHistogramCounts100("Extensions.NotAllowlistedDisabled", | ||
| 700 | disabled_not_allowlisted_count); | ||
| 701 | - if (safe_browsing::IsEnhancedProtectionEnabled(*profile->GetPrefs())) { | ||
| 702 | - base::UmaHistogramCounts100("Extensions.NotAllowlistedEnabledAndEsbUser", | ||
| 703 | - enabled_not_allowlisted_count); | ||
| 704 | - base::UmaHistogramCounts100("Extensions.NotAllowlistedDisabledAndEsbUser", | ||
| 705 | - disabled_not_allowlisted_count); | ||
| 706 | - } | ||
| 707 | } | ||
| 708 | |||
| 709 | int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { | ||
| 710 | --- chrome/browser/net/profile_network_context_service.cc.orig | ||
| 711 | +++ chrome/browser/net/profile_network_context_service.cc | ||
| 712 | @@ -43,7 +43,6 @@ | ||
| 713 | #include "components/pref_registry/pref_registry_syncable.h" | ||
| 714 | #include "components/prefs/pref_registry_simple.h" | ||
| 715 | #include "components/prefs/pref_service.h" | ||
| 716 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 717 | #include "content/public/browser/browser_context.h" | ||
| 718 | #include "content/public/browser/browser_thread.h" | ||
| 719 | #include "content/public/browser/network_service_instance.h" | ||
| 720 | @@ -741,13 +740,6 @@ void ProfileNetworkContextService::Confi | ||
| 721 | network_context_params->enable_certificate_reporting = true; | ||
| 722 | network_context_params->enable_expect_ct_reporting = true; | ||
| 723 | |||
| 724 | - // Initialize the network context to do SCT auditing only if the current | ||
| 725 | - // profile is opted in to Safe Browsing Extended Reporting. | ||
| 726 | - if (!profile_->IsOffTheRecord() && | ||
| 727 | - safe_browsing::IsExtendedReportingEnabled(*profile_->GetPrefs())) { | ||
| 728 | - network_context_params->enable_sct_auditing = true; | ||
| 729 | - } | ||
| 730 | - | ||
| 731 | network_context_params->ct_policy = GetCTPolicy(); | ||
| 732 | |||
| 733 | #if BUILDFLAG(TRIAL_COMPARISON_CERT_VERIFIER_SUPPORTED) | ||
| 734 | --- chrome/browser/net/trial_comparison_cert_verifier_browsertest.cc.orig | ||
| 735 | +++ chrome/browser/net/trial_comparison_cert_verifier_browsertest.cc | ||
| 736 | @@ -11,7 +11,6 @@ | ||
| 737 | #include "chrome/test/base/in_process_browser_test.h" | ||
| 738 | #include "chrome/test/base/ui_test_utils.h" | ||
| 739 | #include "components/metrics/content/subprocess_metrics_provider.h" | ||
| 740 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 741 | #include "content/public/test/browser_test.h" | ||
| 742 | #include "net/base/features.h" | ||
| 743 | #include "net/cert/trial_comparison_cert_verifier.h" | ||
| 744 | --- chrome/browser/net/trial_comparison_cert_verifier_controller.cc.orig | ||
| 745 | +++ chrome/browser/net/trial_comparison_cert_verifier_controller.cc | ||
| 746 | @@ -19,7 +19,6 @@ | ||
| 747 | #include "chrome/browser/safe_browsing/certificate_reporting_service.h" | ||
| 748 | #include "chrome/browser/safe_browsing/certificate_reporting_service_factory.h" | ||
| 749 | #include "chrome/common/channel_info.h" | ||
| 750 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 751 | #include "components/security_interstitials/content/certificate_error_report.h" | ||
| 752 | #include "content/public/browser/browser_task_traits.h" | ||
| 753 | #include "content/public/browser/browser_thread.h" | ||
| 754 | @@ -42,12 +41,6 @@ TrialComparisonCertVerifierController::T | ||
| 755 | // enabled. | ||
| 756 | return; | ||
| 757 | } | ||
| 758 | - | ||
| 759 | - pref_change_registrar_.Init(profile_->GetPrefs()); | ||
| 760 | - pref_change_registrar_.Add( | ||
| 761 | - prefs::kSafeBrowsingScoutReportingEnabled, | ||
| 762 | - base::BindRepeating(&TrialComparisonCertVerifierController::RefreshState, | ||
| 763 | - base::Unretained(this))); | ||
| 764 | } | ||
| 765 | |||
| 766 | TrialComparisonCertVerifierController:: | ||
| 767 | @@ -101,9 +94,7 @@ bool TrialComparisonCertVerifierControll | ||
| 768 | if (!MaybeAllowedForProfile(profile_)) | ||
| 769 | return false; | ||
| 770 | |||
| 771 | - const PrefService& prefs = *profile_->GetPrefs(); | ||
| 772 | - | ||
| 773 | - return safe_browsing::IsExtendedReportingEnabled(prefs); | ||
| 774 | + return false; | ||
| 775 | } | ||
| 776 | |||
| 777 | void TrialComparisonCertVerifierController::SendTrialReport( | ||
| 778 | --- chrome/browser/net/trial_comparison_cert_verifier_controller.h.orig | ||
| 779 | +++ chrome/browser/net/trial_comparison_cert_verifier_controller.h | ||
| 780 | @@ -14,7 +14,6 @@ | ||
| 781 | #include "base/memory/ref_counted.h" | ||
| 782 | #include "base/memory/weak_ptr.h" | ||
| 783 | #include "base/threading/thread_checker.h" | ||
| 784 | -#include "components/prefs/pref_change_registrar.h" | ||
| 785 | #include "mojo/public/cpp/bindings/pending_receiver.h" | ||
| 786 | #include "mojo/public/cpp/bindings/pending_remote.h" | ||
| 787 | #include "mojo/public/cpp/bindings/receiver_set.h" | ||
| 788 | @@ -77,7 +76,6 @@ class TrialComparisonCertVerifierControl | ||
| 789 | void RefreshState(); | ||
| 790 | |||
| 791 | Profile* profile_; | ||
| 792 | - PrefChangeRegistrar pref_change_registrar_; | ||
| 793 | |||
| 794 | mojo::ReceiverSet< | ||
| 795 | cert_verifier::mojom::TrialComparisonCertVerifierReportClient> | ||
| 796 | --- chrome/browser/net/trial_comparison_cert_verifier_controller_unittest.cc.orig | ||
| 797 | +++ chrome/browser/net/trial_comparison_cert_verifier_controller_unittest.cc | ||
| 798 | @@ -20,7 +20,6 @@ | ||
| 799 | #include "chrome/test/base/testing_browser_process.h" | ||
| 800 | #include "chrome/test/base/testing_profile.h" | ||
| 801 | #include "chrome/test/base/testing_profile_manager.h" | ||
| 802 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 803 | #include "components/security_interstitials/content/cert_logger.pb.h" | ||
| 804 | #include "components/sync_preferences/testing_pref_service_syncable.h" | ||
| 805 | #include "content/public/browser/browser_task_traits.h" | ||
| 806 | --- chrome/browser/password_manager/generated_password_leak_detection_pref.cc.orig | ||
| 807 | +++ chrome/browser/password_manager/generated_password_leak_detection_pref.cc | ||
| 808 | @@ -13,7 +13,6 @@ | ||
| 809 | #include "chrome/common/extensions/api/settings_private.h" | ||
| 810 | #include "components/password_manager/core/common/password_manager_pref_names.h" | ||
| 811 | #include "components/prefs/pref_service.h" | ||
| 812 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 813 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 814 | |||
| 815 | namespace { | ||
| 816 | @@ -43,8 +42,7 @@ bool IsUserSignedInAndSyncing(Profile* p | ||
| 817 | // Returns whether the effective value of the Safe Browsing preferences for | ||
| 818 | // |profile| is standard protection. | ||
| 819 | bool IsSafeBrowsingStandard(Profile* profile) { | ||
| 820 | - return profile->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled) && | ||
| 821 | - !profile->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnhanced); | ||
| 822 | + return false; | ||
| 823 | } | ||
| 824 | |||
| 825 | } // namespace | ||
| 826 | @@ -63,16 +61,6 @@ GeneratedPasswordLeakDetectionPref::Gene | ||
| 827 | base::BindRepeating( | ||
| 828 | &GeneratedPasswordLeakDetectionPref::OnSourcePreferencesChanged, | ||
| 829 | base::Unretained(this))); | ||
| 830 | - user_prefs_registrar_.Add( | ||
| 831 | - prefs::kSafeBrowsingEnabled, | ||
| 832 | - base::BindRepeating( | ||
| 833 | - &GeneratedPasswordLeakDetectionPref::OnSourcePreferencesChanged, | ||
| 834 | - base::Unretained(this))); | ||
| 835 | - user_prefs_registrar_.Add( | ||
| 836 | - prefs::kSafeBrowsingEnhanced, | ||
| 837 | - base::BindRepeating( | ||
| 838 | - &GeneratedPasswordLeakDetectionPref::OnSourcePreferencesChanged, | ||
| 839 | - base::Unretained(this))); | ||
| 840 | |||
| 841 | if (auto* identity_manager = IdentityManagerFactory::GetForProfile(profile)) | ||
| 842 | identity_manager_observer_.Observe(identity_manager); | ||
| 843 | --- chrome/browser/permissions/abusive_origin_permission_revocation_request.cc.orig | ||
| 844 | +++ chrome/browser/permissions/abusive_origin_permission_revocation_request.cc | ||
| 845 | @@ -17,7 +17,6 @@ | ||
| 846 | #include "components/permissions/permissions_client.h" | ||
| 847 | #include "components/prefs/pref_service.h" | ||
| 848 | #include "components/safe_browsing/core/browser/db/database_manager.h" | ||
| 849 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 850 | |||
| 851 | namespace { | ||
| 852 | constexpr char kExcludedKey[] = "exempted"; | ||
| 853 | --- chrome/browser/permissions/prediction_based_permission_ui_selector.cc.orig | ||
| 854 | +++ chrome/browser/permissions/prediction_based_permission_ui_selector.cc | ||
| 855 | @@ -23,7 +23,6 @@ | ||
| 856 | #include "components/permissions/prediction_service/prediction_service.h" | ||
| 857 | #include "components/permissions/prediction_service/prediction_service_messages.pb.h" | ||
| 858 | #include "components/prefs/pref_service.h" | ||
| 859 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 860 | |||
| 861 | namespace { | ||
| 862 | |||
| 863 | --- chrome/browser/policy/browser_signin_policy_handler.cc.orig | ||
| 864 | +++ chrome/browser/policy/browser_signin_policy_handler.cc | ||
| 865 | @@ -15,7 +15,6 @@ | ||
| 866 | #include "components/policy/core/common/policy_map.h" | ||
| 867 | #include "components/policy/policy_constants.h" | ||
| 868 | #include "components/prefs/pref_value_map.h" | ||
| 869 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 870 | |||
| 871 | namespace policy { | ||
| 872 | BrowserSigninPolicyHandler::BrowserSigninPolicyHandler(Schema chrome_schema) | ||
| 873 | @@ -48,28 +47,18 @@ void BrowserSigninPolicyHandler::ApplyPo | ||
| 874 | #endif | ||
| 875 | FALLTHROUGH; | ||
| 876 | case BrowserSigninMode::kEnabled: | ||
| 877 | +#if !defined(OS_ANDROID) | ||
| 878 | prefs->SetValue( | ||
| 879 | -#if defined(OS_ANDROID) | ||
| 880 | - // The new kSigninAllowedOnNextStartup pref is only used on Desktop. | ||
| 881 | - // Keep the old kSigninAllowed pref for Android until the policy is | ||
| 882 | - // fully deprecated in M71 and can be removed. | ||
| 883 | - prefs::kSigninAllowed, | ||
| 884 | -#else | ||
| 885 | prefs::kSigninAllowedOnNextStartup, | ||
| 886 | -#endif | ||
| 887 | base::Value(true)); | ||
| 888 | +#endif | ||
| 889 | break; | ||
| 890 | case BrowserSigninMode::kDisabled: | ||
| 891 | +#if !defined(OS_ANDROID) | ||
| 892 | prefs->SetValue( | ||
| 893 | -#if defined(OS_ANDROID) | ||
| 894 | - // The new kSigninAllowedOnNextStartup pref is only used on Desktop. | ||
| 895 | - // Keep the old kSigninAllowed pref for Android until the policy is | ||
| 896 | - // fully deprecated in M71 and can be removed. | ||
| 897 | - prefs::kSigninAllowed, | ||
| 898 | -#else | ||
| 899 | prefs::kSigninAllowedOnNextStartup, | ||
| 900 | -#endif | ||
| 901 | base::Value(false)); | ||
| 902 | +#endif | ||
| 903 | break; | ||
| 904 | } | ||
| 905 | } | ||
| 906 | --- chrome/browser/policy/configuration_policy_handler_list_factory.cc.orig | ||
| 907 | +++ chrome/browser/policy/configuration_policy_handler_list_factory.cc | ||
| 908 | @@ -83,12 +83,9 @@ | ||
| 909 | #include "components/policy/core/common/schema.h" | ||
| 910 | #include "components/policy/policy_constants.h" | ||
| 911 | #include "components/proxy_config/proxy_policy_handler.h" | ||
| 912 | -#include "components/safe_browsing/core/common/safe_browsing_policy_handler.h" | ||
| 913 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 914 | #include "components/search_engines/default_search_policy_handler.h" | ||
| 915 | #include "components/search_engines/search_engines_pref_names.h" | ||
| 916 | #include "components/security_interstitials/core/pref_names.h" | ||
| 917 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 918 | #include "components/spellcheck/spellcheck_buildflags.h" | ||
| 919 | #include "components/sync/base/pref_names.h" | ||
| 920 | #include "components/sync/driver/sync_policy_handler.h" | ||
| 921 | @@ -209,15 +206,6 @@ const PolicyToPreferenceMapEntry kSimple | ||
| 922 | { key::kQuicAllowed, | ||
| 923 | prefs::kQuicAllowed, | ||
| 924 | base::Value::Type::BOOLEAN }, | ||
| 925 | - { key::kSafeBrowsingEnabled, | ||
| 926 | - prefs::kSafeBrowsingEnabled, | ||
| 927 | - base::Value::Type::BOOLEAN }, | ||
| 928 | - { key::kSafeBrowsingForTrustedSourcesEnabled, | ||
| 929 | - prefs::kSafeBrowsingForTrustedSourcesEnabled, | ||
| 930 | - base::Value::Type::BOOLEAN }, | ||
| 931 | - { key::kSafeBrowsingExtendedReportingEnabled, | ||
| 932 | - prefs::kSafeBrowsingScoutReportingEnabled, | ||
| 933 | - base::Value::Type::BOOLEAN }, | ||
| 934 | { key::kUrlKeyedAnonymizedDataCollectionEnabled, | ||
| 935 | unified_consent::prefs::kUrlKeyedAnonymizedDataCollectionEnabled, | ||
| 936 | base::Value::Type::BOOLEAN }, | ||
| 937 | @@ -353,15 +341,6 @@ const PolicyToPreferenceMapEntry kSimple | ||
| 938 | { key::kGloballyScopeHTTPAuthCacheEnabled, | ||
| 939 | prefs::kGloballyScopeHTTPAuthCacheEnabled, | ||
| 940 | base::Value::Type::BOOLEAN }, | ||
| 941 | - { key::kPasswordProtectionWarningTrigger, | ||
| 942 | - prefs::kPasswordProtectionWarningTrigger, | ||
| 943 | - base::Value::Type::INTEGER }, | ||
| 944 | - { key::kPasswordProtectionLoginURLs, | ||
| 945 | - prefs::kPasswordProtectionLoginURLs, | ||
| 946 | - base::Value::Type::LIST }, | ||
| 947 | - { key::kPasswordProtectionChangePasswordURL, | ||
| 948 | - prefs::kPasswordProtectionChangePasswordURL, | ||
| 949 | - base::Value::Type::STRING }, | ||
| 950 | { key::kSafeSitesFilterBehavior, | ||
| 951 | policy_prefs::kSafeSitesFilterBehavior, | ||
| 952 | base::Value::Type::INTEGER }, | ||
| 953 | @@ -470,18 +449,12 @@ const PolicyToPreferenceMapEntry kSimple | ||
| 954 | { key::kMaxConnectionsPerProxy, | ||
| 955 | prefs::kMaxConnectionsPerProxy, | ||
| 956 | base::Value::Type::INTEGER }, | ||
| 957 | - { key::kRestrictSigninToPattern, | ||
| 958 | - prefs::kGoogleServicesUsernamePattern, | ||
| 959 | - base::Value::Type::STRING }, | ||
| 960 | { key::kDefaultWebBluetoothGuardSetting, | ||
| 961 | prefs::kManagedDefaultWebBluetoothGuardSetting, | ||
| 962 | base::Value::Type::INTEGER }, | ||
| 963 | { key::kDefaultMediaStreamSetting, | ||
| 964 | prefs::kManagedDefaultMediaStreamSetting, | ||
| 965 | base::Value::Type::INTEGER }, | ||
| 966 | - { key::kDisableSafeBrowsingProceedAnyway, | ||
| 967 | - prefs::kSafeBrowsingProceedAnywayDisabled, | ||
| 968 | - base::Value::Type::BOOLEAN }, | ||
| 969 | { key::kCECPQ2Enabled, | ||
| 970 | prefs::kCECPQ2Enabled, | ||
| 971 | base::Value::Type::BOOLEAN }, | ||
| 972 | @@ -684,9 +657,6 @@ const PolicyToPreferenceMapEntry kSimple | ||
| 973 | { key::kIntranetRedirectBehavior, | ||
| 974 | omnibox::kIntranetRedirectBehavior, | ||
| 975 | base::Value::Type::INTEGER }, | ||
| 976 | - { key::kAdvancedProtectionAllowed, | ||
| 977 | - prefs::kAdvancedProtectionAllowed, | ||
| 978 | - base::Value::Type::BOOLEAN }, | ||
| 979 | { key::kAccessibilityImageLabelsEnabled, | ||
| 980 | prefs::kAccessibilityImageLabelsEnabled, | ||
| 981 | base::Value::Type::BOOLEAN }, | ||
| 982 | @@ -1642,8 +1612,6 @@ std::unique_ptr<ConfigurationPolicyHandl | ||
| 983 | handlers->AddHandler(std::make_unique<JavascriptPolicyHandler>()); | ||
| 984 | handlers->AddHandler(std::make_unique<NetworkPredictionPolicyHandler>()); | ||
| 985 | handlers->AddHandler(std::make_unique<RestoreOnStartupPolicyHandler>()); | ||
| 986 | - handlers->AddHandler( | ||
| 987 | - std::make_unique<safe_browsing::SafeBrowsingPolicyHandler>()); | ||
| 988 | handlers->AddHandler(std::make_unique<SimpleDeprecatingPolicyHandler>( | ||
| 989 | std::make_unique<SimplePolicyHandler>(key::kAuthServerWhitelist, | ||
| 990 | prefs::kAuthServerAllowlist, | ||
| 991 | @@ -1667,9 +1635,6 @@ std::unique_ptr<ConfigurationPolicyHandl | ||
| 992 | key::kWindowOcclusionEnabled, | ||
| 993 | policy::policy_prefs::kNativeWindowOcclusionEnabled, | ||
| 994 | base::Value::Type::BOOLEAN))); | ||
| 995 | - handlers->AddHandler(std::make_unique<SimplePolicyHandler>( | ||
| 996 | - key::kSafeBrowsingAllowlistDomains, prefs::kSafeBrowsingAllowlistDomains, | ||
| 997 | - base::Value::Type::LIST)); | ||
| 998 | handlers->AddHandler(std::make_unique<syncer::SyncPolicyHandler>()); | ||
| 999 | handlers->AddHandler(std::make_unique<BrowsingHistoryPolicyHandler>()); | ||
| 1000 | |||
| 1001 | @@ -1762,12 +1727,6 @@ std::unique_ptr<ConfigurationPolicyHandl | ||
| 1002 | key::kOnSecurityEventEnterpriseConnector, | ||
| 1003 | enterprise_connectors::kOnSecurityEventPref, | ||
| 1004 | enterprise_connectors::kOnSecurityEventScopePref, chrome_schema)); | ||
| 1005 | - handlers->AddHandler( | ||
| 1006 | - std::make_unique< | ||
| 1007 | - enterprise_connectors::EnterpriseConnectorsPolicyHandler>( | ||
| 1008 | - key::kEnterpriseRealTimeUrlCheckMode, | ||
| 1009 | - prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckMode, | ||
| 1010 | - prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckScope, chrome_schema)); | ||
| 1011 | |||
| 1012 | handlers->AddHandler(std::make_unique<BrowsingDataLifetimePolicyHandler>( | ||
| 1013 | key::kClearBrowsingDataOnExitList, | ||
| 1014 | @@ -1806,17 +1765,6 @@ std::unique_ptr<ConfigurationPolicyHandl | ||
| 1015 | signin_legacy_policies.push_back(std::make_unique<SimplePolicyHandler>( | ||
| 1016 | key::kForceBrowserSignin, prefs::kForceBrowserSignin, | ||
| 1017 | base::Value::Type::BOOLEAN)); | ||
| 1018 | - signin_legacy_policies.push_back(std::make_unique<SimplePolicyHandler>( | ||
| 1019 | - key::kSigninAllowed, | ||
| 1020 | -#if defined(OS_ANDROID) | ||
| 1021 | - // The new kSigninAllowedOnNextStartup pref is only used on Desktop. | ||
| 1022 | - // Keep the old kSigninAllowed pref for Android until the policy is | ||
| 1023 | - // fully deprecated in M71 and can be removed. | ||
| 1024 | - prefs::kSigninAllowed, | ||
| 1025 | -#else // defined(OS_ANDROID) | ||
| 1026 | - prefs::kSigninAllowedOnNextStartup, | ||
| 1027 | -#endif // defined(OS_ANDROID) | ||
| 1028 | - base::Value::Type::BOOLEAN)); | ||
| 1029 | handlers->AddHandler(std::make_unique<LegacyPoliciesDeprecatingPolicyHandler>( | ||
| 1030 | std::move(signin_legacy_policies), | ||
| 1031 | std::make_unique<BrowserSigninPolicyHandler>(chrome_schema))); | ||
| 1032 | --- chrome/browser/prefs/browser_prefs.cc.orig | ||
| 1033 | +++ chrome/browser/prefs/browser_prefs.cc | ||
| 1034 | @@ -139,7 +139,6 @@ | ||
| 1035 | #include "components/prefs/pref_service.h" | ||
| 1036 | #include "components/privacy_sandbox/privacy_sandbox_prefs.h" | ||
| 1037 | #include "components/proxy_config/pref_proxy_config_tracker_impl.h" | ||
| 1038 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1039 | #include "components/search_engines/template_url_prepopulate_data.h" | ||
| 1040 | #include "components/security_interstitials/content/insecure_form_blocking_page.h" | ||
| 1041 | #include "components/security_interstitials/content/stateful_ssl_host_state_delegate.h" | ||
| 1042 | @@ -921,7 +920,6 @@ void RegisterLocalState(PrefRegistrySimp | ||
| 1043 | ProfileNetworkContextService::RegisterLocalStatePrefs(registry); | ||
| 1044 | profiles::RegisterPrefs(registry); | ||
| 1045 | RegisterScreenshotPrefs(registry); | ||
| 1046 | - safe_browsing::RegisterLocalStatePrefs(registry); | ||
| 1047 | secure_origin_allowlist::RegisterPrefs(registry); | ||
| 1048 | #if !defined(OS_ANDROID) | ||
| 1049 | SerialPolicyAllowedPorts::RegisterPrefs(registry); | ||
| 1050 | @@ -1171,7 +1169,6 @@ void RegisterProfilePrefs(user_prefs::Pr | ||
| 1051 | PushMessagingAppIdentifier::RegisterProfilePrefs(registry); | ||
| 1052 | QuietNotificationPermissionUiState::RegisterProfilePrefs(registry); | ||
| 1053 | RegisterBrowserUserPrefs(registry); | ||
| 1054 | - safe_browsing::RegisterProfilePrefs(registry); | ||
| 1055 | SearchPrefetchService::RegisterProfilePrefs(registry); | ||
| 1056 | blocked_content::SafeBrowsingTriggeredPopupBlocker::RegisterProfilePrefs( | ||
| 1057 | registry); | ||
| 1058 | --- chrome/browser/prefs/chrome_command_line_pref_store.cc.orig | ||
| 1059 | +++ chrome/browser/prefs/chrome_command_line_pref_store.cc | ||
| 1060 | @@ -31,7 +31,6 @@ | ||
| 1061 | #include "components/language/core/browser/pref_names.h" | ||
| 1062 | #include "components/proxy_config/proxy_config_dictionary.h" | ||
| 1063 | #include "components/proxy_config/proxy_config_pref_names.h" | ||
| 1064 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1065 | #include "components/safe_browsing/core/common/safebrowsing_switches.h" | ||
| 1066 | #include "components/sync/base/pref_names.h" | ||
| 1067 | #include "content/public/common/content_switches.h" | ||
| 1068 | @@ -78,8 +77,6 @@ const CommandLinePrefStore::BooleanSwitc | ||
| 1069 | {switches::kAllowCrossOriginAuthPrompt, | ||
| 1070 | prefs::kAllowCrossOriginAuthPrompt, true}, | ||
| 1071 | {switches::kDisablePrintPreview, prefs::kPrintPreviewDisabled, true}, | ||
| 1072 | - {safe_browsing::switches::kSbEnableEnhancedProtection, | ||
| 1073 | - prefs::kSafeBrowsingEnhanced, true}, | ||
| 1074 | #if BUILDFLAG(IS_CHROMEOS_ASH) | ||
| 1075 | {chromeos::switches::kEnableTouchpadThreeFingerClick, | ||
| 1076 | prefs::kEnableTouchpadThreeFingerClick, true}, | ||
| 1077 | --- chrome/browser/prefs/chrome_pref_service_factory.cc.orig | ||
| 1078 | +++ chrome/browser/prefs/chrome_pref_service_factory.cc | ||
| 1079 | @@ -48,10 +48,8 @@ | ||
| 1080 | #include "components/prefs/pref_service.h" | ||
| 1081 | #include "components/prefs/pref_store.h" | ||
| 1082 | #include "components/prefs/pref_value_store.h" | ||
| 1083 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1084 | #include "components/search_engines/default_search_manager.h" | ||
| 1085 | #include "components/search_engines/search_engines_pref_names.h" | ||
| 1086 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 1087 | #include "components/sync/base/model_type.h" | ||
| 1088 | #include "components/sync/base/pref_names.h" | ||
| 1089 | #include "components/sync_preferences/pref_model_associator.h" | ||
| 1090 | @@ -121,8 +119,6 @@ const prefs::TrackedPreferenceMetadata k | ||
| 1091 | {5, extensions::pref_names::kExtensions, EnforcementLevel::NO_ENFORCEMENT, | ||
| 1092 | PrefTrackingStrategy::SPLIT, ValueType::IMPERSONAL}, | ||
| 1093 | #endif | ||
| 1094 | - {6, prefs::kGoogleServicesLastUsername, EnforcementLevel::ENFORCE_ON_LOAD, | ||
| 1095 | - PrefTrackingStrategy::ATOMIC, ValueType::PERSONAL}, | ||
| 1096 | {7, prefs::kSearchProviderOverrides, EnforcementLevel::ENFORCE_ON_LOAD, | ||
| 1097 | PrefTrackingStrategy::ATOMIC, ValueType::IMPERSONAL}, | ||
| 1098 | #if !defined(OS_ANDROID) | ||
| 1099 | @@ -146,8 +142,6 @@ const prefs::TrackedPreferenceMetadata k | ||
| 1100 | PrefTrackingStrategy::ATOMIC, ValueType::IMPERSONAL}, | ||
| 1101 | // kSyncRemainingRollbackTries is deprecated and will be removed a few | ||
| 1102 | // releases after M50. | ||
| 1103 | - {18, prefs::kSafeBrowsingIncidentsSent, EnforcementLevel::ENFORCE_ON_LOAD, | ||
| 1104 | - PrefTrackingStrategy::ATOMIC, ValueType::IMPERSONAL}, | ||
| 1105 | #if defined(OS_WIN) | ||
| 1106 | {19, prefs::kSwReporterPromptVersion, EnforcementLevel::ENFORCE_ON_LOAD, | ||
| 1107 | PrefTrackingStrategy::ATOMIC, ValueType::IMPERSONAL}, | ||
| 1108 | @@ -156,10 +150,6 @@ const prefs::TrackedPreferenceMetadata k | ||
| 1109 | {22, prefs::kSwReporterPromptSeed, EnforcementLevel::ENFORCE_ON_LOAD, | ||
| 1110 | PrefTrackingStrategy::ATOMIC, ValueType::IMPERSONAL}, | ||
| 1111 | #endif | ||
| 1112 | - {23, prefs::kGoogleServicesAccountId, EnforcementLevel::ENFORCE_ON_LOAD, | ||
| 1113 | - PrefTrackingStrategy::ATOMIC, ValueType::PERSONAL}, | ||
| 1114 | - {24, prefs::kGoogleServicesLastAccountId, EnforcementLevel::ENFORCE_ON_LOAD, | ||
| 1115 | - PrefTrackingStrategy::ATOMIC, ValueType::PERSONAL}, | ||
| 1116 | #if defined(OS_WIN) | ||
| 1117 | {25, prefs::kSettingsResetPromptPromptWave, | ||
| 1118 | EnforcementLevel::ENFORCE_ON_LOAD, PrefTrackingStrategy::ATOMIC, | ||
| 1119 | --- chrome/browser/prefs/pref_functional_browsertest.cc.orig | ||
| 1120 | +++ chrome/browser/prefs/pref_functional_browsertest.cc | ||
| 1121 | @@ -24,7 +24,6 @@ | ||
| 1122 | #include "components/content_settings/core/common/content_settings_types.h" | ||
| 1123 | #include "components/content_settings/core/common/pref_names.h" | ||
| 1124 | #include "components/embedder_support/pref_names.h" | ||
| 1125 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1126 | #include "components/sync_preferences/pref_service_syncable.h" | ||
| 1127 | #include "content/public/browser/web_contents.h" | ||
| 1128 | #include "content/public/test/browser_test.h" | ||
| 1129 | @@ -220,9 +219,6 @@ IN_PROC_BROWSER_TEST_F(PrefsFunctionalTe | ||
| 1130 | prefs->SetInteger(prefs::kNetworkPredictionOptions, | ||
| 1131 | chrome_browser_net::NETWORK_PREDICTION_NEVER); | ||
| 1132 | |||
| 1133 | - EXPECT_TRUE(prefs->GetBoolean(prefs::kSafeBrowsingEnabled)); | ||
| 1134 | - prefs->SetBoolean(prefs::kSafeBrowsingEnabled, false); | ||
| 1135 | - | ||
| 1136 | EXPECT_TRUE(prefs->GetBoolean(embedder_support::kAlternateErrorPagesEnabled)); | ||
| 1137 | prefs->SetBoolean(embedder_support::kAlternateErrorPagesEnabled, false); | ||
| 1138 | |||
| 1139 | @@ -236,7 +232,6 @@ IN_PROC_BROWSER_TEST_F(PrefsFunctionalTe | ||
| 1140 | |||
| 1141 | EXPECT_EQ(chrome_browser_net::NETWORK_PREDICTION_NEVER, | ||
| 1142 | prefs->GetInteger(prefs::kNetworkPredictionOptions)); | ||
| 1143 | - EXPECT_FALSE(prefs->GetBoolean(prefs::kSafeBrowsingEnabled)); | ||
| 1144 | EXPECT_FALSE( | ||
| 1145 | prefs->GetBoolean(embedder_support::kAlternateErrorPagesEnabled)); | ||
| 1146 | EXPECT_FALSE(prefs->GetBoolean(prefs::kSearchSuggestEnabled)); | ||
| 1147 | --- chrome/browser/profiles/gaia_info_update_service.cc.orig | ||
| 1148 | +++ chrome/browser/profiles/gaia_info_update_service.cc | ||
| 1149 | @@ -19,7 +19,6 @@ | ||
| 1150 | #include "chrome/common/pref_names.h" | ||
| 1151 | #include "components/prefs/pref_service.h" | ||
| 1152 | #include "components/signin/public/base/avatar_icon_util.h" | ||
| 1153 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 1154 | #include "components/signin/public/identity_manager/account_info.h" | ||
| 1155 | #include "components/signin/public/identity_manager/accounts_in_cookie_jar_info.h" | ||
| 1156 | #include "components/signin/public/identity_manager/consent_level.h" | ||
| 1157 | --- chrome/browser/profiles/gaia_info_update_service_unittest.cc.orig | ||
| 1158 | +++ chrome/browser/profiles/gaia_info_update_service_unittest.cc | ||
| 1159 | @@ -27,7 +27,6 @@ | ||
| 1160 | #include "chrome/test/base/testing_profile_manager.h" | ||
| 1161 | #include "components/prefs/pref_service.h" | ||
| 1162 | #include "components/profile_metrics/state.h" | ||
| 1163 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 1164 | #include "components/signin/public/identity_manager/account_info.h" | ||
| 1165 | #include "components/sync_preferences/pref_service_syncable.h" | ||
| 1166 | #include "content/public/test/browser_task_environment.h" | ||
| 1167 | --- chrome/browser/profiles/profile_attributes_entry.cc.orig | ||
| 1168 | +++ chrome/browser/profiles/profile_attributes_entry.cc | ||
| 1169 | @@ -29,7 +29,6 @@ | ||
| 1170 | #include "components/prefs/pref_service.h" | ||
| 1171 | #include "components/prefs/scoped_user_pref_update.h" | ||
| 1172 | #include "components/profile_metrics/state.h" | ||
| 1173 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 1174 | #include "components/signin/public/identity_manager/account_info.h" | ||
| 1175 | #include "third_party/abseil-cpp/absl/types/optional.h" | ||
| 1176 | #include "ui/base/resource/resource_bundle.h" | ||
| 1177 | @@ -490,7 +489,7 @@ bool ProfileAttributesEntry::IsUsingDefa | ||
| 1178 | } | ||
| 1179 | |||
| 1180 | bool ProfileAttributesEntry::IsSignedInWithCredentialProvider() const { | ||
| 1181 | - return GetBool(prefs::kSignedInWithCredentialProvider); | ||
| 1182 | + return false; | ||
| 1183 | } | ||
| 1184 | |||
| 1185 | size_t ProfileAttributesEntry::GetAvatarIconIndex() const { | ||
| 1186 | @@ -672,9 +671,6 @@ void ProfileAttributesEntry::SetLastDown | ||
| 1187 | } | ||
| 1188 | |||
| 1189 | void ProfileAttributesEntry::SetSignedInWithCredentialProvider(bool value) { | ||
| 1190 | - if (value != GetBool(prefs::kSignedInWithCredentialProvider)) { | ||
| 1191 | - SetBool(prefs::kSignedInWithCredentialProvider, value); | ||
| 1192 | - } | ||
| 1193 | } | ||
| 1194 | |||
| 1195 | void ProfileAttributesEntry::LockForceSigninProfile(bool is_lock) { | ||
| 1196 | --- chrome/browser/profiles/profile_attributes_storage.cc.orig | ||
| 1197 | +++ chrome/browser/profiles/profile_attributes_storage.cc | ||
| 1198 | @@ -36,7 +36,6 @@ | ||
| 1199 | #include "components/prefs/scoped_user_pref_update.h" | ||
| 1200 | #include "components/profile_metrics/state.h" | ||
| 1201 | #include "components/signin/public/base/persistent_repeating_timer.h" | ||
| 1202 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 1203 | #include "content/public/browser/browser_task_traits.h" | ||
| 1204 | #include "content/public/browser/browser_thread.h" | ||
| 1205 | #include "third_party/icu/source/i18n/unicode/coll.h" | ||
| 1206 | @@ -374,8 +373,6 @@ void ProfileAttributesStorage::AddProfil | ||
| 1207 | if (params.account_id.HasAccountIdKey()) | ||
| 1208 | info.SetStringKey(ProfileAttributesEntry::kAccountIdKey, | ||
| 1209 | params.account_id.GetAccountIdKey()); | ||
| 1210 | - info.SetBoolKey(prefs::kSignedInWithCredentialProvider, | ||
| 1211 | - params.is_signed_in_with_credential_provider); | ||
| 1212 | attributes->SetKey(key, std::move(info)); | ||
| 1213 | |||
| 1214 | ProfileAttributesEntry* entry = InitEntryWithKey(key, params.is_omitted); | ||
| 1215 | --- chrome/browser/profiles/profile_impl.cc.orig | ||
| 1216 | +++ chrome/browser/profiles/profile_impl.cc | ||
| 1217 | @@ -150,7 +150,6 @@ | ||
| 1218 | #include "components/prefs/scoped_user_pref_update.h" | ||
| 1219 | #include "components/profile_metrics/browser_profile_type.h" | ||
| 1220 | #include "components/security_interstitials/content/stateful_ssl_host_state_delegate.h" | ||
| 1221 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 1222 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 1223 | #include "components/site_isolation/site_isolation_policy.h" | ||
| 1224 | #include "components/spellcheck/spellcheck_buildflags.h" | ||
| 1225 | --- chrome/browser/profiles/profile_manager.cc.orig | ||
| 1226 | +++ chrome/browser/profiles/profile_manager.cc | ||
| 1227 | @@ -94,7 +94,6 @@ | ||
| 1228 | #include "components/search_engines/default_search_manager.h" | ||
| 1229 | #include "components/signin/public/base/signin_buildflags.h" | ||
| 1230 | #include "components/signin/public/base/signin_metrics.h" | ||
| 1231 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 1232 | #include "components/signin/public/identity_manager/consent_level.h" | ||
| 1233 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 1234 | #include "components/signin/public/identity_manager/primary_account_mutator.h" | ||
| 1235 | @@ -2105,8 +2104,7 @@ void ProfileManager::AddProfileToStorage | ||
| 1236 | entry->SetAuthInfo(account_info.gaia, username, | ||
| 1237 | is_consented_primary_account); | ||
| 1238 | |||
| 1239 | - entry->SetSignedInWithCredentialProvider(profile->GetPrefs()->GetBoolean( | ||
| 1240 | - prefs::kSignedInWithCredentialProvider)); | ||
| 1241 | + entry->SetSignedInWithCredentialProvider(false); | ||
| 1242 | |||
| 1243 | #if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) | ||
| 1244 | // Sign out if force-sign-in policy is enabled and profile is not signed | ||
| 1245 | @@ -2161,14 +2159,13 @@ void ProfileManager::AddProfileToStorage | ||
| 1246 | |||
| 1247 | init_params.is_ephemeral = IsEphemeral(profile); | ||
| 1248 | init_params.is_signed_in_with_credential_provider = | ||
| 1249 | - profile->GetPrefs()->GetBoolean(prefs::kSignedInWithCredentialProvider); | ||
| 1250 | + false; | ||
| 1251 | |||
| 1252 | storage.AddProfile(std::move(init_params)); | ||
| 1253 | } | ||
| 1254 | |||
| 1255 | void ProfileManager::SetNonPersonalProfilePrefs(Profile* profile) { | ||
| 1256 | PrefService* prefs = profile->GetPrefs(); | ||
| 1257 | - prefs->SetBoolean(prefs::kSigninAllowed, false); | ||
| 1258 | prefs->SetBoolean(bookmarks::prefs::kEditBookmarksEnabled, false); | ||
| 1259 | prefs->SetBoolean(bookmarks::prefs::kShowBookmarkBar, false); | ||
| 1260 | prefs->ClearPref(DefaultSearchManager::kDefaultSearchProviderDataPrefName); | ||
| 1261 | --- chrome/browser/profiles/profile_window.cc.orig | ||
| 1262 | +++ chrome/browser/profiles/profile_window.cc | ||
| 1263 | @@ -40,7 +40,6 @@ | ||
| 1264 | #include "chrome/common/url_constants.h" | ||
| 1265 | #include "components/flags_ui/pref_service_flags_storage.h" | ||
| 1266 | #include "components/prefs/pref_service.h" | ||
| 1267 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 1268 | #include "components/signin/public/identity_manager/account_info.h" | ||
| 1269 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 1270 | #include "content/public/browser/browser_thread.h" | ||
| 1271 | --- chrome/browser/profiles/profiles_state.cc.orig | ||
| 1272 | +++ chrome/browser/profiles/profiles_state.cc | ||
| 1273 | @@ -42,7 +42,6 @@ | ||
| 1274 | #include <algorithm> | ||
| 1275 | #include "chrome/browser/profiles/gaia_info_update_service.h" | ||
| 1276 | #include "chrome/browser/profiles/gaia_info_update_service_factory.h" | ||
| 1277 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 1278 | #endif | ||
| 1279 | |||
| 1280 | #if BUILDFLAG(IS_CHROMEOS_LACROS) | ||
| 1281 | --- chrome/browser/resources/settings/privacy_page/disable_safebrowsing_dialog.html.orig | ||
| 1282 | +++ chrome/browser/resources/settings/privacy_page/disable_safebrowsing_dialog.html | ||
| 1283 | @@ -1,12 +1,9 @@ | ||
| 1284 | <cr-dialog id="dialog" close-text="$i18n{close}"> | ||
| 1285 | - <div slot="title">$i18n{safeBrowsingDisableDialog}</div> | ||
| 1286 | - <div slot="body">$i18n{safeBrowsingDisableDialogDesc}</div> | ||
| 1287 | <div slot="button-container"> | ||
| 1288 | <cr-button class="cancel-button" on-click="onDialogCancel_"> | ||
| 1289 | $i18n{cancel} | ||
| 1290 | </cr-button> | ||
| 1291 | <cr-button class="action-button" on-click="onDialogConfirm_"> | ||
| 1292 | - $i18n{safeBrowsingDisableDialogConfirm} | ||
| 1293 | </cr-button> | ||
| 1294 | </div> | ||
| 1295 | </cr-dialog> | ||
| 1296 | --- chrome/browser/resources/settings/privacy_page/privacy_page.html.orig | ||
| 1297 | +++ chrome/browser/resources/settings/privacy_page/privacy_page.html | ||
| 1298 | @@ -535,7 +535,7 @@ | ||
| 1299 | </category-setting-exceptions> | ||
| 1300 | </settings-subpage> | ||
| 1301 | </template> | ||
| 1302 | - <template is="dom-if" if="[[enableSafeBrowsingSubresourceFilter_]]" | ||
| 1303 | + <template is="dom-if" if="[[false]]" | ||
| 1304 | no-search> | ||
| 1305 | <template is="dom-if" route-path="/content/ads" no-search> | ||
| 1306 | <settings-subpage page-title="$i18n{siteSettingsAds}" | ||
| 1307 | --- chrome/browser/resources/settings/privacy_page/privacy_page.ts.orig | ||
| 1308 | +++ chrome/browser/resources/settings/privacy_page/privacy_page.ts | ||
| 1309 | @@ -90,7 +90,7 @@ export class SettingsPrivacyPageElement | ||
| 1310 | enableSafeBrowsingSubresourceFilter_: { | ||
| 1311 | type: Boolean, | ||
| 1312 | value() { | ||
| 1313 | - return loadTimeData.getBoolean('enableSafeBrowsingSubresourceFilter'); | ||
| 1314 | + return false; | ||
| 1315 | } | ||
| 1316 | }, | ||
| 1317 | |||
| 1318 | --- chrome/browser/resources/settings/privacy_page/security_page.html.orig | ||
| 1319 | +++ chrome/browser/resources/settings/privacy_page/security_page.html | ||
| 1320 | @@ -53,105 +53,6 @@ | ||
| 1321 | <img id="banner" alt="" | ||
| 1322 | src="chrome://settings/images/safe_browsing_banner.svg"> | ||
| 1323 | </picture> | ||
| 1324 | - <div id="safeBrowsingSection"> | ||
| 1325 | - <h2>$i18n{safeBrowsingSectionLabel}</h2> | ||
| 1326 | - <settings-radio-group id="safeBrowsingRadioGroup" no-set-pref | ||
| 1327 | - pref="{{prefs.generated.safe_browsing}}" | ||
| 1328 | - selectable-elements="cr-radio-button, settings-collapse-radio-button" | ||
| 1329 | - on-change="onSafeBrowsingRadioChange_"> | ||
| 1330 | - <settings-collapse-radio-button id="safeBrowsingEnhanced" | ||
| 1331 | - name="[[safeBrowsingSettingEnum_.ENHANCED]]" | ||
| 1332 | - pref="[[prefs.generated.safe_browsing]]" | ||
| 1333 | - label="$i18n{safeBrowsingEnhanced}" | ||
| 1334 | - sub-label="$i18n{safeBrowsingEnhancedDesc}" | ||
| 1335 | - indicator-aria-label="$i18n{controlledSettingPolicy}" | ||
| 1336 | - expand-aria-label="$i18n{safeBrowsingEnhancedExpandA11yLabel}" | ||
| 1337 | - on-expand-clicked="onEnhancedProtectionExpandButtonClicked_" | ||
| 1338 | - no-automatic-collapse> | ||
| 1339 | - <div slot="collapse"> | ||
| 1340 | - <div class="bullet-line"> | ||
| 1341 | - <iron-icon icon="cr:security"></iron-icon> | ||
| 1342 | - <div class="secondary"> | ||
| 1343 | - $i18n{safeBrowsingEnhancedBulOne} | ||
| 1344 | - </div> | ||
| 1345 | - </div> | ||
| 1346 | - <div class="bullet-line"> | ||
| 1347 | - <iron-icon icon="settings20:googleg"></iron-icon> | ||
| 1348 | - <div class="secondary"> | ||
| 1349 | - $i18n{safeBrowsingEnhancedBulTwo} | ||
| 1350 | - </div> | ||
| 1351 | - </div> | ||
| 1352 | - <div class="bullet-line"> | ||
| 1353 | - <iron-icon icon="settings:public"></iron-icon> | ||
| 1354 | - <div class="secondary"> | ||
| 1355 | - $i18n{safeBrowsingEnhancedBulThree} | ||
| 1356 | - </div> | ||
| 1357 | - </div> | ||
| 1358 | - <div class="bullet-line"> | ||
| 1359 | - <iron-icon icon="settings20:vpn-key"></iron-icon> | ||
| 1360 | - <div class="secondary"> | ||
| 1361 | - $i18n{safeBrowsingEnhancedBulFour} | ||
| 1362 | - </div> | ||
| 1363 | - </div> | ||
| 1364 | - <div class="bullet-line last-collapse-item"> | ||
| 1365 | - <iron-icon icon="settings20:data"></iron-icon> | ||
| 1366 | - <div class="secondary cr-padded-text"> | ||
| 1367 | - $i18n{safeBrowsingEnhancedBulFive} | ||
| 1368 | - </div> | ||
| 1369 | - </div> | ||
| 1370 | - </div> | ||
| 1371 | - </settings-collapse-radio-button> | ||
| 1372 | - <settings-collapse-radio-button id="safeBrowsingStandard" | ||
| 1373 | - name="[[safeBrowsingSettingEnum_.STANDARD]]" | ||
| 1374 | - pref="[[prefs.generated.safe_browsing]]" | ||
| 1375 | - label="$i18n{safeBrowsingStandard}" | ||
| 1376 | - sub-label="$i18n{safeBrowsingStandardDesc}" | ||
| 1377 | - indicator-aria-label="$i18n{controlledSettingPolicy}" | ||
| 1378 | - expand-aria-label="$i18n{safeBrowsingStandardExpandA11yLabel}" | ||
| 1379 | - info-opened="{{infoOpened_}}" | ||
| 1380 | - on-expand-clicked="onStandardProtectionExpandButtonClicked_" | ||
| 1381 | - no-automatic-collapse> | ||
| 1382 | - <div slot="collapse"> | ||
| 1383 | - <div class="bullet-line"> | ||
| 1384 | - <iron-icon icon="cr:security"></iron-icon> | ||
| 1385 | - <div class="secondary"> | ||
| 1386 | - $i18n{safeBrowsingStandardBulOne} | ||
| 1387 | - </div> | ||
| 1388 | - </div> | ||
| 1389 | - <div class="bullet-line"> | ||
| 1390 | - <iron-icon icon="settings20:data"></iron-icon> | ||
| 1391 | - <div class="secondary cr-padded-text"> | ||
| 1392 | - $i18n{safeBrowsingStandardBulTwo} | ||
| 1393 | - </div> | ||
| 1394 | - </div> | ||
| 1395 | - </div> | ||
| 1396 | - <div slot="noSelectionCollapse"> | ||
| 1397 | - <settings-toggle-button id="safeBrowsingReportingToggle" | ||
| 1398 | - pref="{{prefs.safebrowsing.scout_reporting_enabled}}" | ||
| 1399 | - label="$i18n{safeBrowsingStandardReportingLabel}" | ||
| 1400 | - sub-label="$i18n{safeBrowsingEnableExtendedReportingDesc}" | ||
| 1401 | - on-change="onSafeBrowsingExtendedReportingChange_" | ||
| 1402 | - disabled="[[getDisabledExtendedSafeBrowsing_( | ||
| 1403 | - prefs.generated.safe_browsing.*)]]"> | ||
| 1404 | - </settings-toggle-button> | ||
| 1405 | - <settings-toggle-button id="passwordsLeakToggle" | ||
| 1406 | - label="$i18n{passwordsLeakDetectionLabel}" | ||
| 1407 | - pref="{{prefs.generated.password_leak_detection}}" | ||
| 1408 | - sub-label="[[getPasswordsLeakToggleSubLabel_( | ||
| 1409 | - prefs.profile.password_manager_leak_detection.*, | ||
| 1410 | - prefs.generated.password_leak_detection.*)]]"> | ||
| 1411 | - </settings-toggle-button> | ||
| 1412 | - </div> | ||
| 1413 | - </settings-collapse-radio-button> | ||
| 1414 | - <settings-collapse-radio-button id="safeBrowsingDisabled" no-collapse | ||
| 1415 | - name="[[safeBrowsingSettingEnum_.DISABLED]]" | ||
| 1416 | - pref="[[prefs.generated.safe_browsing]]" | ||
| 1417 | - label="$i18n{safeBrowsingNone}" | ||
| 1418 | - sub-label="$i18n{safeBrowsingNoneDesc}" | ||
| 1419 | - indicator-aria-label="$i18n{controlledSettingPolicy}"> | ||
| 1420 | - </settings-collapse-radio-button> | ||
| 1421 | - </settings-radio-group> | ||
| 1422 | - </div> | ||
| 1423 | <div class="cr-row first"> | ||
| 1424 | <h2>$i18n{advancedPageTitle}</h2> | ||
| 1425 | </div> | ||
| 1426 | @@ -202,8 +103,3 @@ | ||
| 1427 | on-click="onAdvancedProtectionProgramLinkClick_" | ||
| 1428 | external> | ||
| 1429 | </cr-link-row> | ||
| 1430 | - <template is="dom-if" if="[[showDisableSafebrowsingDialog_]]" restamp> | ||
| 1431 | - <settings-disable-safebrowsing-dialog prefs="{{prefs}}" | ||
| 1432 | - on-close="onDisableSafebrowsingDialogClose_"> | ||
| 1433 | - </settings-disable-safebrowsing-dialog> | ||
| 1434 | - </template> | ||
| 1435 | --- chrome/browser/resources/settings/privacy_page/security_page.ts.orig | ||
| 1436 | +++ chrome/browser/resources/settings/privacy_page/security_page.ts | ||
| 1437 | @@ -182,15 +182,6 @@ export class SettingsSecurityPageElement | ||
| 1438 | |||
| 1439 | ready() { | ||
| 1440 | super.ready(); | ||
| 1441 | - | ||
| 1442 | - // Expand initial pref value manually because automatic | ||
| 1443 | - // expanding is disabled. | ||
| 1444 | - const prefValue = this.getPref('generated.safe_browsing').value; | ||
| 1445 | - if (prefValue === SafeBrowsingSetting.ENHANCED) { | ||
| 1446 | - this.$.safeBrowsingEnhanced.expanded = true; | ||
| 1447 | - } else if (prefValue === SafeBrowsingSetting.STANDARD) { | ||
| 1448 | - this.$.safeBrowsingStandard.expanded = true; | ||
| 1449 | - } | ||
| 1450 | } | ||
| 1451 | |||
| 1452 | /** | ||
| 1453 | @@ -239,8 +230,7 @@ export class SettingsSecurityPageElement | ||
| 1454 | } | ||
| 1455 | |||
| 1456 | private getDisabledExtendedSafeBrowsing_(): boolean { | ||
| 1457 | - return this.getPref('generated.safe_browsing').value !== | ||
| 1458 | - SafeBrowsingSetting.STANDARD; | ||
| 1459 | + return true; | ||
| 1460 | } | ||
| 1461 | |||
| 1462 | private getPasswordsLeakToggleSubLabel_(): string { | ||
| 1463 | --- chrome/browser/resources/settings/site_settings_page/site_settings_page.ts.orig | ||
| 1464 | +++ chrome/browser/resources/settings/site_settings_page/site_settings_page.ts | ||
| 1465 | @@ -47,7 +47,7 @@ function getCategoryItemMap(): Map<Conte | ||
| 1466 | enabledLabel: 'siteSettingsAdsAllowed', | ||
| 1467 | disabledLabel: 'siteSettingsAdsBlocked', | ||
| 1468 | shouldShow: () => | ||
| 1469 | - loadTimeData.getBoolean('enableSafeBrowsingSubresourceFilter'), | ||
| 1470 | + false, | ||
| 1471 | }, | ||
| 1472 | { | ||
| 1473 | route: routes.SITE_SETTINGS_AR, | ||
| 1474 | --- chrome/browser/safe_browsing/ad_redirect_trigger_browsertest.cc.orig | ||
| 1475 | +++ chrome/browser/safe_browsing/ad_redirect_trigger_browsertest.cc | ||
| 1476 | @@ -19,7 +19,6 @@ | ||
| 1477 | #include "components/prefs/testing_pref_service.h" | ||
| 1478 | #include "components/safe_browsing/content/browser/triggers/ad_redirect_trigger.h" | ||
| 1479 | #include "components/safe_browsing/core/common/features.h" | ||
| 1480 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1481 | #include "content/public/browser/render_frame_host.h" | ||
| 1482 | #include "content/public/browser/web_contents.h" | ||
| 1483 | #include "content/public/test/browser_test.h" | ||
| 1484 | --- chrome/browser/safe_browsing/advanced_protection_status_manager.cc.orig | ||
| 1485 | +++ chrome/browser/safe_browsing/advanced_protection_status_manager.cc | ||
| 1486 | @@ -13,7 +13,6 @@ | ||
| 1487 | #include "chrome/browser/signin/identity_manager_factory.h" | ||
| 1488 | #include "components/prefs/pref_service.h" | ||
| 1489 | #include "components/safe_browsing/core/common/features.h" | ||
| 1490 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1491 | #include "components/signin/public/identity_manager/account_info.h" | ||
| 1492 | #include "components/signin/public/identity_manager/accounts_mutator.h" | ||
| 1493 | #include "components/signin/public/identity_manager/consent_level.h" | ||
| 1494 | @@ -63,9 +62,7 @@ void AdvancedProtectionStatusManager::Ma | ||
| 1495 | |||
| 1496 | is_under_advanced_protection_ = core_info.is_under_advanced_protection; | ||
| 1497 | |||
| 1498 | - if (pref_service_->HasPrefPath(prefs::kAdvancedProtectionLastRefreshInUs)) { | ||
| 1499 | - last_refreshed_ = base::Time::FromDeltaSinceWindowsEpoch(base::Microseconds( | ||
| 1500 | - pref_service_->GetInt64(prefs::kAdvancedProtectionLastRefreshInUs))); | ||
| 1501 | + if (false) { | ||
| 1502 | if (is_under_advanced_protection_) | ||
| 1503 | ScheduleNextRefresh(); | ||
| 1504 | } else { | ||
| 1505 | @@ -231,20 +228,10 @@ void AdvancedProtectionStatusManager::Ca | ||
| 1506 | |||
| 1507 | void AdvancedProtectionStatusManager::UpdateLastRefreshTime() { | ||
| 1508 | last_refreshed_ = base::Time::Now(); | ||
| 1509 | - pref_service_->SetInt64( | ||
| 1510 | - prefs::kAdvancedProtectionLastRefreshInUs, | ||
| 1511 | - last_refreshed_.ToDeltaSinceWindowsEpoch().InMicroseconds()); | ||
| 1512 | } | ||
| 1513 | |||
| 1514 | bool AdvancedProtectionStatusManager::IsUnderAdvancedProtection() const { | ||
| 1515 | - if (!pref_service_->GetBoolean(prefs::kAdvancedProtectionAllowed)) | ||
| 1516 | - return false; | ||
| 1517 | - | ||
| 1518 | - if (base::CommandLine::ForCurrentProcess()->HasSwitch( | ||
| 1519 | - kForceTreatUserAsAdvancedProtection)) | ||
| 1520 | - return true; | ||
| 1521 | - | ||
| 1522 | - return is_under_advanced_protection_; | ||
| 1523 | + return false; | ||
| 1524 | } | ||
| 1525 | |||
| 1526 | bool AdvancedProtectionStatusManager::IsUnconsentedPrimaryAccount( | ||
| 1527 | --- chrome/browser/safe_browsing/advanced_protection_status_manager_unittest.cc.orig | ||
| 1528 | +++ chrome/browser/safe_browsing/advanced_protection_status_manager_unittest.cc | ||
| 1529 | @@ -10,7 +10,6 @@ | ||
| 1530 | #include "base/test/task_environment.h" | ||
| 1531 | #include "build/chromeos_buildflags.h" | ||
| 1532 | #include "components/prefs/pref_service.h" | ||
| 1533 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1534 | #include "components/signin/public/identity_manager/account_info.h" | ||
| 1535 | #include "components/signin/public/identity_manager/accounts_mutator.h" | ||
| 1536 | #include "components/signin/public/identity_manager/identity_test_environment.h" | ||
| 1537 | --- chrome/browser/safe_browsing/android/services_delegate_android.h.orig | ||
| 1538 | +++ chrome/browser/safe_browsing/android/services_delegate_android.h | ||
| 1539 | @@ -7,7 +7,6 @@ | ||
| 1540 | |||
| 1541 | #include "base/macros.h" | ||
| 1542 | #include "chrome/browser/safe_browsing/services_delegate.h" | ||
| 1543 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1544 | |||
| 1545 | namespace safe_browsing { | ||
| 1546 | |||
| 1547 | --- chrome/browser/safe_browsing/certificate_reporting_service.cc.orig | ||
| 1548 | +++ chrome/browser/safe_browsing/certificate_reporting_service.cc | ||
| 1549 | @@ -14,7 +14,6 @@ | ||
| 1550 | #include "chrome/browser/profiles/profile.h" | ||
| 1551 | #include "chrome/browser/safe_browsing/safe_browsing_service.h" | ||
| 1552 | #include "components/prefs/pref_service.h" | ||
| 1553 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1554 | #include "components/security_interstitials/content/certificate_error_report.h" | ||
| 1555 | #include "content/public/browser/browser_thread.h" | ||
| 1556 | #include "services/network/public/cpp/shared_url_loader_factory.h" | ||
| 1557 | --- chrome/browser/safe_browsing/certificate_reporting_service_browsertest.cc.orig | ||
| 1558 | +++ chrome/browser/safe_browsing/certificate_reporting_service_browsertest.cc | ||
| 1559 | @@ -27,7 +27,6 @@ | ||
| 1560 | #include "chrome/test/base/in_process_browser_test.h" | ||
| 1561 | #include "chrome/test/base/ui_test_utils.h" | ||
| 1562 | #include "components/prefs/pref_service.h" | ||
| 1563 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1564 | #include "components/security_interstitials/content/cert_report_helper.h" | ||
| 1565 | #include "components/security_interstitials/content/certificate_error_report.h" | ||
| 1566 | #include "components/variations/variations_params_manager.h" | ||
| 1567 | --- chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_impl_win.cc.orig | ||
| 1568 | +++ chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_impl_win.cc | ||
| 1569 | @@ -43,7 +43,6 @@ | ||
| 1570 | #include "components/component_updater/component_updater_service.h" | ||
| 1571 | #include "components/component_updater/pref_names.h" | ||
| 1572 | #include "components/prefs/pref_service.h" | ||
| 1573 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1574 | #include "content/public/browser/browser_task_traits.h" | ||
| 1575 | #include "content/public/browser/browser_thread.h" | ||
| 1576 | #include "net/http/http_status_code.h" | ||
| 1577 | --- chrome/browser/safe_browsing/chrome_cleaner/reporter_runner_browsertest_win.cc.orig | ||
| 1578 | +++ chrome/browser/safe_browsing/chrome_cleaner/reporter_runner_browsertest_win.cc | ||
| 1579 | @@ -44,7 +44,6 @@ | ||
| 1580 | #include "components/policy/core/common/mock_configuration_policy_provider.h" | ||
| 1581 | #include "components/policy/policy_constants.h" | ||
| 1582 | #include "components/prefs/pref_service.h" | ||
| 1583 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1584 | #include "content/public/test/browser_test.h" | ||
| 1585 | #include "testing/gmock/include/gmock/gmock.h" | ||
| 1586 | #include "testing/gtest/include/gtest/gtest.h" | ||
| 1587 | --- chrome/browser/safe_browsing/chrome_cleaner/srt_client_info_win.cc.orig | ||
| 1588 | +++ chrome/browser/safe_browsing/chrome_cleaner/srt_client_info_win.cc | ||
| 1589 | @@ -12,7 +12,6 @@ | ||
| 1590 | #include "chrome/browser/profiles/profile.h" | ||
| 1591 | #include "chrome/browser/profiles/profile_manager.h" | ||
| 1592 | #include "chrome/common/channel_info.h" | ||
| 1593 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1594 | #include "components/version_info/version_info.h" | ||
| 1595 | |||
| 1596 | namespace safe_browsing { | ||
| 1597 | --- chrome/browser/safe_browsing/chrome_password_protection_service.cc.orig | ||
| 1598 | +++ chrome/browser/safe_browsing/chrome_password_protection_service.cc | ||
| 1599 | @@ -63,7 +63,6 @@ | ||
| 1600 | #include "components/safe_browsing/core/browser/verdict_cache_manager.h" | ||
| 1601 | #include "components/safe_browsing/core/common/features.h" | ||
| 1602 | #include "components/safe_browsing/core/common/proto/csd.pb.h" | ||
| 1603 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1604 | #include "components/safe_browsing/core/common/safebrowsing_constants.h" | ||
| 1605 | #include "components/safe_browsing/core/common/utils.h" | ||
| 1606 | #include "components/security_interstitials/content/unsafe_resource_util.h" | ||
| 1607 | @@ -1220,14 +1219,6 @@ bool ChromePasswordProtectionService::Ha | ||
| 1608 | } | ||
| 1609 | |||
| 1610 | void ChromePasswordProtectionService::OnWarningTriggerChanged() { | ||
| 1611 | - const base::Value* pref_value = pref_change_registrar_->prefs()->Get( | ||
| 1612 | - prefs::kPasswordProtectionWarningTrigger); | ||
| 1613 | - // If password protection is not turned off, do nothing. | ||
| 1614 | - if (static_cast<PasswordProtectionTrigger>(pref_value->GetInt()) != | ||
| 1615 | - PASSWORD_PROTECTION_OFF) { | ||
| 1616 | - return; | ||
| 1617 | - } | ||
| 1618 | - | ||
| 1619 | // Clears captured enterprise password hashes or GSuite sync password hashes. | ||
| 1620 | password_manager::PasswordReuseManager* reuse_manager = | ||
| 1621 | GetPasswordReuseManager(); | ||
| 1622 | @@ -1385,7 +1376,7 @@ PrefService* ChromePasswordProtectionSer | ||
| 1623 | } | ||
| 1624 | |||
| 1625 | bool ChromePasswordProtectionService::IsSafeBrowsingEnabled() { | ||
| 1626 | - return ::safe_browsing::IsSafeBrowsingEnabled(*GetPrefs()); | ||
| 1627 | + return false; | ||
| 1628 | } | ||
| 1629 | |||
| 1630 | bool ChromePasswordProtectionService::IsExtendedReporting() { | ||
| 1631 | @@ -1405,44 +1396,7 @@ bool ChromePasswordProtectionService::Is | ||
| 1632 | bool ChromePasswordProtectionService::IsPingingEnabled( | ||
| 1633 | LoginReputationClientRequest::TriggerType trigger_type, | ||
| 1634 | ReusedPasswordAccountType password_type) { | ||
| 1635 | - if (!IsSafeBrowsingEnabled()) { | ||
| 1636 | - return false; | ||
| 1637 | - } | ||
| 1638 | - bool extended_reporting_enabled = IsExtendedReporting(); | ||
| 1639 | - if (trigger_type == LoginReputationClientRequest::PASSWORD_REUSE_EVENT) { | ||
| 1640 | - if (password_type.account_type() == | ||
| 1641 | - ReusedPasswordAccountType::SAVED_PASSWORD) { | ||
| 1642 | - return true; | ||
| 1643 | - } | ||
| 1644 | - | ||
| 1645 | - // Only override policy if password protection is off for Gmail users. | ||
| 1646 | - if (GetPasswordProtectionWarningTriggerPref(password_type) == | ||
| 1647 | - PASSWORD_PROTECTION_OFF) { | ||
| 1648 | - return false; | ||
| 1649 | - } | ||
| 1650 | - // If the account type is UNKNOWN (i.e. AccountInfo fields could not be | ||
| 1651 | - // retrieved from server), pings should be gated by SBER. | ||
| 1652 | - if (password_type.account_type() == ReusedPasswordAccountType::UNKNOWN) { | ||
| 1653 | - return extended_reporting_enabled; | ||
| 1654 | - } | ||
| 1655 | - | ||
| 1656 | -// Only saved password and GAIA password reuse warnings are shown to users on | ||
| 1657 | -// Android, so other types of password reuse events should be gated by Safe | ||
| 1658 | -// Browsing extended reporting. | ||
| 1659 | -#if defined(OS_ANDROID) | ||
| 1660 | - if (password_type.account_type() == | ||
| 1661 | - ReusedPasswordAccountType::SAVED_PASSWORD || | ||
| 1662 | - IsSyncingGMAILPasswordWithSignedInProtectionEnabled(password_type)) { | ||
| 1663 | - return true; | ||
| 1664 | - } | ||
| 1665 | - | ||
| 1666 | - return extended_reporting_enabled; | ||
| 1667 | -#else | ||
| 1668 | - return true; | ||
| 1669 | -#endif | ||
| 1670 | - } | ||
| 1671 | - | ||
| 1672 | - return !IsIncognito() && extended_reporting_enabled; | ||
| 1673 | + return false; | ||
| 1674 | } | ||
| 1675 | |||
| 1676 | RequestOutcome ChromePasswordProtectionService::GetPingNotSentReason( | ||
| 1677 | @@ -1661,22 +1615,6 @@ MaybeCreateNavigationThrottle(content::N | ||
| 1678 | : nullptr; | ||
| 1679 | } | ||
| 1680 | |||
| 1681 | -PasswordProtectionTrigger | ||
| 1682 | -ChromePasswordProtectionService::GetPasswordProtectionWarningTriggerPref( | ||
| 1683 | - ReusedPasswordAccountType password_type) const { | ||
| 1684 | - if (password_type.account_type() == ReusedPasswordAccountType::GMAIL || | ||
| 1685 | - (password_type.account_type() == | ||
| 1686 | - ReusedPasswordAccountType::SAVED_PASSWORD)) | ||
| 1687 | - return PHISHING_REUSE; | ||
| 1688 | - | ||
| 1689 | - bool is_policy_managed = profile_->GetPrefs()->HasPrefPath( | ||
| 1690 | - prefs::kPasswordProtectionWarningTrigger); | ||
| 1691 | - PasswordProtectionTrigger trigger_level = | ||
| 1692 | - static_cast<PasswordProtectionTrigger>(profile_->GetPrefs()->GetInteger( | ||
| 1693 | - prefs::kPasswordProtectionWarningTrigger)); | ||
| 1694 | - return is_policy_managed ? trigger_level : PHISHING_REUSE; | ||
| 1695 | -} | ||
| 1696 | - | ||
| 1697 | bool ChromePasswordProtectionService::IsURLAllowlistedForPasswordEntry( | ||
| 1698 | const GURL& url) const { | ||
| 1699 | if (!profile_) | ||
| 1700 | --- chrome/browser/safe_browsing/chrome_password_protection_service.h.orig | ||
| 1701 | +++ chrome/browser/safe_browsing/chrome_password_protection_service.h | ||
| 1702 | @@ -211,13 +211,6 @@ class ChromePasswordProtectionService : | ||
| 1703 | bool UserClickedThroughSBInterstitial( | ||
| 1704 | PasswordProtectionRequest* request) override; | ||
| 1705 | |||
| 1706 | - // If |prefs::kPasswordProtectionWarningTrigger| is not managed by enterprise | ||
| 1707 | - // policy, this function should always return PHISHING_REUSE. Otherwise, | ||
| 1708 | - // returns the specified pref value adjusted for the given username's account | ||
| 1709 | - // type. | ||
| 1710 | - PasswordProtectionTrigger GetPasswordProtectionWarningTriggerPref( | ||
| 1711 | - ReusedPasswordAccountType password_type) const override; | ||
| 1712 | - | ||
| 1713 | // If |url| matches Safe Browsing allowlist domains, password protection | ||
| 1714 | // change password URL, or password protection login URLs in the enterprise | ||
| 1715 | // policy. | ||
| 1716 | --- chrome/browser/safe_browsing/chrome_password_protection_service_browsertest.cc.orig | ||
| 1717 | +++ chrome/browser/safe_browsing/chrome_password_protection_service_browsertest.cc | ||
| 1718 | @@ -38,7 +38,6 @@ | ||
| 1719 | #include "components/safe_browsing/content/browser/password_protection/password_protection_test_util.h" | ||
| 1720 | #include "components/safe_browsing/core/browser/password_protection/metrics_util.h" | ||
| 1721 | #include "components/safe_browsing/core/common/features.h" | ||
| 1722 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1723 | #include "components/security_state/core/security_state.h" | ||
| 1724 | #include "components/signin/public/identity_manager/account_info.h" | ||
| 1725 | #include "components/signin/public/identity_manager/identity_test_environment.h" | ||
| 1726 | --- chrome/browser/safe_browsing/chrome_password_protection_service_sync_browsertest.cc.orig | ||
| 1727 | +++ chrome/browser/safe_browsing/chrome_password_protection_service_sync_browsertest.cc | ||
| 1728 | @@ -28,9 +28,7 @@ | ||
| 1729 | #include "components/prefs/pref_service.h" | ||
| 1730 | #include "components/prefs/scoped_user_pref_update.h" | ||
| 1731 | #include "components/safe_browsing/content/browser/password_protection/password_protection_request_content.h" | ||
| 1732 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1733 | #include "components/security_state/core/security_state.h" | ||
| 1734 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 1735 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 1736 | #include "components/signin/public/identity_manager/identity_test_utils.h" | ||
| 1737 | #include "components/sync/driver/sync_service.h" | ||
| 1738 | --- chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.cc.orig | ||
| 1739 | +++ chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.cc | ||
| 1740 | @@ -34,7 +34,6 @@ | ||
| 1741 | #include "components/prefs/pref_service.h" | ||
| 1742 | #include "components/safe_browsing/content/browser/web_ui/safe_browsing_ui.h" | ||
| 1743 | #include "components/safe_browsing/core/common/features.h" | ||
| 1744 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1745 | |||
| 1746 | #include "content/public/browser/browser_task_traits.h" | ||
| 1747 | #include "content/public/browser/browser_thread.h" | ||
| 1748 | --- chrome/browser/safe_browsing/download_protection/check_client_download_request.cc.orig | ||
| 1749 | +++ chrome/browser/safe_browsing/download_protection/check_client_download_request.cc | ||
| 1750 | @@ -38,7 +38,6 @@ | ||
| 1751 | #include "components/safe_browsing/content/common/file_type_policies.h" | ||
| 1752 | #include "components/safe_browsing/core/common/features.h" | ||
| 1753 | #include "components/safe_browsing/core/common/proto/csd.pb.h" | ||
| 1754 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1755 | #include "components/safe_browsing/core/common/utils.h" | ||
| 1756 | #include "components/url_matcher/url_matcher.h" | ||
| 1757 | #include "content/public/browser/browser_context.h" | ||
| 1758 | --- chrome/browser/safe_browsing/download_protection/check_client_download_request_base.cc.orig | ||
| 1759 | +++ chrome/browser/safe_browsing/download_protection/check_client_download_request_base.cc | ||
| 1760 | @@ -24,7 +24,6 @@ | ||
| 1761 | #include "components/safe_browsing/content/browser/web_ui/safe_browsing_ui.h" | ||
| 1762 | #include "components/safe_browsing/content/common/file_type_policies.h" | ||
| 1763 | #include "components/safe_browsing/core/common/features.h" | ||
| 1764 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1765 | #include "components/safe_browsing/core/common/utils.h" | ||
| 1766 | #include "content/public/browser/browser_context.h" | ||
| 1767 | #include "content/public/browser/browser_task_traits.h" | ||
| 1768 | --- chrome/browser/safe_browsing/download_protection/download_protection_service_unittest.cc.orig | ||
| 1769 | +++ chrome/browser/safe_browsing/download_protection/download_protection_service_unittest.cc | ||
| 1770 | @@ -93,7 +93,6 @@ | ||
| 1771 | #include "components/safe_browsing/core/browser/db/v4_protocol_manager_util.h" | ||
| 1772 | #include "components/safe_browsing/core/common/features.h" | ||
| 1773 | #include "components/safe_browsing/core/common/proto/csd.pb.h" | ||
| 1774 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1775 | #include "components/safe_browsing/core/common/safebrowsing_switches.h" | ||
| 1776 | #include "components/signin/public/identity_manager/identity_test_environment.h" | ||
| 1777 | #include "content/public/browser/browser_task_traits.h" | ||
| 1778 | --- chrome/browser/safe_browsing/generated_safe_browsing_pref.cc.orig | ||
| 1779 | +++ chrome/browser/safe_browsing/generated_safe_browsing_pref.cc | ||
| 1780 | @@ -7,7 +7,6 @@ | ||
| 1781 | #include "chrome/browser/profiles/profile.h" | ||
| 1782 | #include "chrome/common/extensions/api/settings_private.h" | ||
| 1783 | #include "components/prefs/pref_service.h" | ||
| 1784 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1785 | |||
| 1786 | namespace settings_api = extensions::api::settings_private; | ||
| 1787 | |||
| 1788 | @@ -18,21 +17,6 @@ const char kGeneratedSafeBrowsingPref[] | ||
| 1789 | GeneratedSafeBrowsingPref::GeneratedSafeBrowsingPref(Profile* profile) | ||
| 1790 | : profile_(profile) { | ||
| 1791 | user_prefs_registrar_.Init(profile->GetPrefs()); | ||
| 1792 | - user_prefs_registrar_.Add( | ||
| 1793 | - prefs::kSafeBrowsingEnabled, | ||
| 1794 | - base::BindRepeating( | ||
| 1795 | - &GeneratedSafeBrowsingPref::OnSafeBrowsingPreferencesChanged, | ||
| 1796 | - base::Unretained(this))); | ||
| 1797 | - user_prefs_registrar_.Add( | ||
| 1798 | - prefs::kSafeBrowsingEnhanced, | ||
| 1799 | - base::BindRepeating( | ||
| 1800 | - &GeneratedSafeBrowsingPref::OnSafeBrowsingPreferencesChanged, | ||
| 1801 | - base::Unretained(this))); | ||
| 1802 | - user_prefs_registrar_.Add( | ||
| 1803 | - prefs::kSafeBrowsingScoutReportingEnabled, | ||
| 1804 | - base::BindRepeating( | ||
| 1805 | - &GeneratedSafeBrowsingPref::OnSafeBrowsingPreferencesChanged, | ||
| 1806 | - base::Unretained(this))); | ||
| 1807 | } | ||
| 1808 | |||
| 1809 | extensions::settings_private::SetPrefResult GeneratedSafeBrowsingPref::SetPref( | ||
| 1810 | @@ -48,31 +32,14 @@ extensions::settings_private::SetPrefRes | ||
| 1811 | return extensions::settings_private::SetPrefResult::PREF_TYPE_MISMATCH; | ||
| 1812 | |||
| 1813 | // If SBER is forcefully disabled, Enhanced cannot be selected by the user. | ||
| 1814 | - const PrefService::Preference* reporting_pref = | ||
| 1815 | - profile_->GetPrefs()->FindPreference( | ||
| 1816 | - prefs::kSafeBrowsingScoutReportingEnabled); | ||
| 1817 | - const bool reporting_on = reporting_pref->GetValue()->GetBool(); | ||
| 1818 | - const bool reporting_enforced = !reporting_pref->IsUserModifiable(); | ||
| 1819 | + const bool reporting_on = false; | ||
| 1820 | + const bool reporting_enforced = false; | ||
| 1821 | |||
| 1822 | if (reporting_enforced && !reporting_on && | ||
| 1823 | selection == SafeBrowsingSetting::ENHANCED) { | ||
| 1824 | return extensions::settings_private::SetPrefResult::PREF_NOT_MODIFIABLE; | ||
| 1825 | } | ||
| 1826 | |||
| 1827 | - // kSafeBrowsingEnabled is considered the canonical source for Safe Browsing | ||
| 1828 | - // management. | ||
| 1829 | - const PrefService::Preference* enabled_pref = | ||
| 1830 | - profile_->GetPrefs()->FindPreference(prefs::kSafeBrowsingEnabled); | ||
| 1831 | - if (!enabled_pref->IsUserModifiable()) { | ||
| 1832 | - return extensions::settings_private::SetPrefResult::PREF_NOT_MODIFIABLE; | ||
| 1833 | - } | ||
| 1834 | - | ||
| 1835 | - // Update both Safe Browsing preferences to match selection. | ||
| 1836 | - profile_->GetPrefs()->SetBoolean(prefs::kSafeBrowsingEnabled, | ||
| 1837 | - selection != SafeBrowsingSetting::DISABLED); | ||
| 1838 | - profile_->GetPrefs()->SetBoolean(prefs::kSafeBrowsingEnhanced, | ||
| 1839 | - selection == SafeBrowsingSetting::ENHANCED); | ||
| 1840 | - | ||
| 1841 | return extensions::settings_private::SetPrefResult::SUCCESS; | ||
| 1842 | } | ||
| 1843 | |||
| 1844 | @@ -83,10 +50,8 @@ GeneratedSafeBrowsingPref::GetPrefObject | ||
| 1845 | pref_object->key = kGeneratedSafeBrowsingPref; | ||
| 1846 | pref_object->type = extensions::api::settings_private::PREF_TYPE_NUMBER; | ||
| 1847 | |||
| 1848 | - auto safe_browsing_enabled = | ||
| 1849 | - profile_->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled); | ||
| 1850 | - auto safe_browsing_enhanced_enabled = | ||
| 1851 | - profile_->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnhanced); | ||
| 1852 | + auto safe_browsing_enabled = false; | ||
| 1853 | + auto safe_browsing_enhanced_enabled = false; | ||
| 1854 | |||
| 1855 | if (safe_browsing_enhanced_enabled && safe_browsing_enabled) { | ||
| 1856 | pref_object->value = std::make_unique<base::Value>( | ||
| 1857 | @@ -116,29 +81,18 @@ void GeneratedSafeBrowsingPref::ApplySaf | ||
| 1858 | // three different preferences. It is possible that these may be in | ||
| 1859 | // temporarily conflicting managed states. The enabled preference is always | ||
| 1860 | // taken as the canonical source of management. | ||
| 1861 | - const PrefService::Preference* enabled_pref = | ||
| 1862 | - profile->GetPrefs()->FindPreference(prefs::kSafeBrowsingEnabled); | ||
| 1863 | - const bool enabled_enforced = !enabled_pref->IsUserModifiable(); | ||
| 1864 | - const bool enabled_recommended = | ||
| 1865 | - (enabled_pref && enabled_pref->GetRecommendedValue()); | ||
| 1866 | - const bool enabled_recommended_on = | ||
| 1867 | - enabled_recommended && enabled_pref->GetRecommendedValue()->GetBool(); | ||
| 1868 | + const bool enabled_enforced = false; | ||
| 1869 | + const bool enabled_recommended = false; | ||
| 1870 | + const bool enabled_recommended_on = false; | ||
| 1871 | |||
| 1872 | // The enhanced preference may have a recommended setting. This only takes | ||
| 1873 | // effect if the enabled preference also has a recommended setting. | ||
| 1874 | - const PrefService::Preference* enhanced_pref = | ||
| 1875 | - profile->GetPrefs()->FindPreference(prefs::kSafeBrowsingEnhanced); | ||
| 1876 | - const bool enhanced_recommended_on = | ||
| 1877 | - enhanced_pref->GetRecommendedValue() && | ||
| 1878 | - enhanced_pref->GetRecommendedValue()->GetBool(); | ||
| 1879 | + const bool enhanced_recommended_on = false; | ||
| 1880 | |||
| 1881 | // A forcefully disabled reporting preference will disallow enhanced from | ||
| 1882 | // being selected and thus it must also be considered. | ||
| 1883 | - const PrefService::Preference* reporting_pref = | ||
| 1884 | - profile->GetPrefs()->FindPreference( | ||
| 1885 | - prefs::kSafeBrowsingScoutReportingEnabled); | ||
| 1886 | - const bool reporting_on = reporting_pref->GetValue()->GetBool(); | ||
| 1887 | - const bool reporting_enforced = !reporting_pref->IsUserModifiable(); | ||
| 1888 | + const bool reporting_on = false; | ||
| 1889 | + const bool reporting_enforced = false; | ||
| 1890 | |||
| 1891 | if (!enabled_enforced && !enabled_recommended && !reporting_enforced) { | ||
| 1892 | // No relevant policies are applied. | ||
| 1893 | @@ -148,8 +102,6 @@ void GeneratedSafeBrowsingPref::ApplySaf | ||
| 1894 | if (enabled_enforced) { | ||
| 1895 | // Preference is fully controlled. | ||
| 1896 | pref_object->enforcement = settings_api::Enforcement::ENFORCEMENT_ENFORCED; | ||
| 1897 | - extensions::settings_private::GeneratedPref::ApplyControlledByFromPref( | ||
| 1898 | - pref_object, enabled_pref); | ||
| 1899 | return; | ||
| 1900 | } | ||
| 1901 | |||
| 1902 | @@ -174,8 +126,6 @@ void GeneratedSafeBrowsingPref::ApplySaf | ||
| 1903 | // Reporting has been forcefully disabled by policy. Enhanced protection is | ||
| 1904 | // thus also implicitly disabled by the same policy. | ||
| 1905 | pref_object->enforcement = settings_api::Enforcement::ENFORCEMENT_ENFORCED; | ||
| 1906 | - extensions::settings_private::GeneratedPref::ApplyControlledByFromPref( | ||
| 1907 | - pref_object, reporting_pref); | ||
| 1908 | |||
| 1909 | pref_object->user_selectable_values = | ||
| 1910 | std::make_unique<std::vector<std::unique_ptr<base::Value>>>(); | ||
| 1911 | --- chrome/browser/safe_browsing/incident_reporting/extension_data_collection_unittest.cc.orig | ||
| 1912 | +++ chrome/browser/safe_browsing/incident_reporting/extension_data_collection_unittest.cc | ||
| 1913 | @@ -22,7 +22,6 @@ | ||
| 1914 | #include "chrome/test/base/testing_profile.h" | ||
| 1915 | #include "chrome/test/base/testing_profile_manager.h" | ||
| 1916 | #include "components/safe_browsing/core/common/proto/csd.pb.h" | ||
| 1917 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1918 | #include "components/sync_preferences/testing_pref_service_syncable.h" | ||
| 1919 | #include "content/public/test/browser_task_environment.h" | ||
| 1920 | #include "content/public/test/test_utils.h" | ||
| 1921 | --- chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc.orig | ||
| 1922 | +++ chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc | ||
| 1923 | @@ -42,7 +42,6 @@ | ||
| 1924 | #include "components/prefs/pref_service.h" | ||
| 1925 | #include "components/safe_browsing/core/common/features.h" | ||
| 1926 | #include "components/safe_browsing/core/common/proto/csd.pb.h" | ||
| 1927 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1928 | #include "content/public/browser/browser_thread.h" | ||
| 1929 | #include "content/public/browser/download_item_utils.h" | ||
| 1930 | #include "services/network/public/cpp/shared_url_loader_factory.h" | ||
| 1931 | --- chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc.orig | ||
| 1932 | +++ chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc | ||
| 1933 | @@ -36,7 +36,6 @@ | ||
| 1934 | #include "chrome/test/base/testing_profile.h" | ||
| 1935 | #include "chrome/test/base/testing_profile_manager.h" | ||
| 1936 | #include "components/safe_browsing/core/common/proto/csd.pb.h" | ||
| 1937 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1938 | #include "components/sync_preferences/testing_pref_service_syncable.h" | ||
| 1939 | #include "content/public/test/browser_task_environment.h" | ||
| 1940 | #include "extensions/browser/quota_service.h" | ||
| 1941 | --- chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc.orig | ||
| 1942 | +++ chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc | ||
| 1943 | @@ -43,7 +43,6 @@ | ||
| 1944 | #include "components/history/core/browser/history_database_params.h" | ||
| 1945 | #include "components/history/core/browser/history_service.h" | ||
| 1946 | #include "components/safe_browsing/core/common/proto/csd.pb.h" | ||
| 1947 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1948 | #include "components/sync_preferences/testing_pref_service_syncable.h" | ||
| 1949 | #include "content/public/test/browser_task_environment.h" | ||
| 1950 | #include "content/public/test/test_utils.h" | ||
| 1951 | --- chrome/browser/safe_browsing/incident_reporting/state_store.cc.orig | ||
| 1952 | +++ chrome/browser/safe_browsing/incident_reporting/state_store.cc | ||
| 1953 | @@ -14,7 +14,6 @@ | ||
| 1954 | #include "chrome/browser/safe_browsing/incident_reporting/incident.h" | ||
| 1955 | #include "chrome/browser/safe_browsing/incident_reporting/platform_state_store.h" | ||
| 1956 | #include "components/prefs/pref_service.h" | ||
| 1957 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1958 | |||
| 1959 | namespace safe_browsing { | ||
| 1960 | |||
| 1961 | --- chrome/browser/safe_browsing/incident_reporting/state_store_unittest.cc.orig | ||
| 1962 | +++ chrome/browser/safe_browsing/incident_reporting/state_store_unittest.cc | ||
| 1963 | @@ -21,7 +21,6 @@ | ||
| 1964 | #include "chrome/test/base/testing_profile.h" | ||
| 1965 | #include "chrome/test/base/testing_profile_manager.h" | ||
| 1966 | #include "components/pref_registry/pref_registry_syncable.h" | ||
| 1967 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1968 | #include "components/sync_preferences/pref_service_syncable.h" | ||
| 1969 | #include "components/sync_preferences/pref_service_syncable_factory.h" | ||
| 1970 | #include "content/public/test/browser_task_environment.h" | ||
| 1971 | --- chrome/browser/safe_browsing/metrics/safe_browsing_metrics_provider.cc.orig | ||
| 1972 | +++ chrome/browser/safe_browsing/metrics/safe_browsing_metrics_provider.cc | ||
| 1973 | @@ -7,7 +7,6 @@ | ||
| 1974 | #include "base/metrics/histogram_functions.h" | ||
| 1975 | #include "chrome/browser/profiles/profile.h" | ||
| 1976 | #include "components/prefs/pref_service.h" | ||
| 1977 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1978 | |||
| 1979 | namespace safe_browsing { | ||
| 1980 | |||
| 1981 | --- chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc.orig | ||
| 1982 | +++ chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc | ||
| 1983 | @@ -74,7 +74,6 @@ | ||
| 1984 | #include "components/safe_browsing/core/browser/safe_browsing_metrics_collector.h" | ||
| 1985 | #include "components/safe_browsing/core/browser/verdict_cache_manager.h" | ||
| 1986 | #include "components/safe_browsing/core/common/features.h" | ||
| 1987 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 1988 | #include "components/safe_browsing/core/common/web_ui_constants.h" | ||
| 1989 | #include "components/security_interstitials/content/security_interstitial_controller_client.h" | ||
| 1990 | #include "components/security_interstitials/content/security_interstitial_tab_helper.h" | ||
| 1991 | --- chrome/browser/safe_browsing/safe_browsing_service.cc.orig | ||
| 1992 | +++ chrome/browser/safe_browsing/safe_browsing_service.cc | ||
| 1993 | @@ -103,7 +103,6 @@ base::FilePath SafeBrowsingService::GetB | ||
| 1994 | |||
| 1995 | SafeBrowsingService::SafeBrowsingService() | ||
| 1996 | : services_delegate_(ServicesDelegate::Create(this)), | ||
| 1997 | - estimated_extended_reporting_by_prefs_(SBER_LEVEL_OFF), | ||
| 1998 | shutdown_(false), | ||
| 1999 | enabled_(false), | ||
| 2000 | enabled_by_prefs_(false) {} | ||
| 2001 | @@ -257,8 +256,6 @@ TriggerManager* SafeBrowsingService::tri | ||
| 2002 | |||
| 2003 | PasswordProtectionService* SafeBrowsingService::GetPasswordProtectionService( | ||
| 2004 | Profile* profile) const { | ||
| 2005 | - if (IsSafeBrowsingEnabled(*profile->GetPrefs())) | ||
| 2006 | - return ChromePasswordProtectionServiceFactory::GetForProfile(profile); | ||
| 2007 | return nullptr; | ||
| 2008 | } | ||
| 2009 | |||
| 2010 | @@ -387,9 +384,6 @@ void SafeBrowsingService::OnProfileAdded | ||
| 2011 | std::unique_ptr<PrefChangeRegistrar> registrar = | ||
| 2012 | std::make_unique<PrefChangeRegistrar>(); | ||
| 2013 | registrar->Init(pref_service); | ||
| 2014 | - registrar->Add(prefs::kSafeBrowsingEnabled, | ||
| 2015 | - base::BindRepeating(&SafeBrowsingService::RefreshState, | ||
| 2016 | - base::Unretained(this))); | ||
| 2017 | // ClientSideDetectionService will need to be refresh the models | ||
| 2018 | // renderers have if extended-reporting changes. | ||
| 2019 | registrar->Add(prefs::kSafeBrowsingScoutReportingEnabled, | ||
| 2020 | @@ -418,14 +412,6 @@ void SafeBrowsingService::OnProfileAdded | ||
| 2021 | NoCachedPopulationReason::kChangeMbbPref)); | ||
| 2022 | user_population_prefs_[pref_service] = std::move(registrar); | ||
| 2023 | |||
| 2024 | - // Record the current pref state for standard protection. | ||
| 2025 | - UMA_HISTOGRAM_BOOLEAN(kSafeBrowsingEnabledHistogramName, | ||
| 2026 | - pref_service->GetBoolean(prefs::kSafeBrowsingEnabled)); | ||
| 2027 | - // Record the current pref state for enhanced protection. Enhanced protection | ||
| 2028 | - // is a subset of the standard protection. Thus, |kSafeBrowsingEnabled| count | ||
| 2029 | - // should always be more than the count of enhanced protection. | ||
| 2030 | - UMA_HISTOGRAM_BOOLEAN("SafeBrowsing.Pref.Enhanced", | ||
| 2031 | - pref_service->GetBoolean(prefs::kSafeBrowsingEnhanced)); | ||
| 2032 | // Extended Reporting metrics are handled together elsewhere. | ||
| 2033 | RecordExtendedReportingMetrics(*pref_service); | ||
| 2034 | |||
| 2035 | @@ -465,18 +451,6 @@ void SafeBrowsingService::RefreshState() | ||
| 2036 | |||
| 2037 | // Check if any profile requires the service to be active. | ||
| 2038 | enabled_by_prefs_ = false; | ||
| 2039 | - estimated_extended_reporting_by_prefs_ = SBER_LEVEL_OFF; | ||
| 2040 | - for (const auto& pref : prefs_map_) { | ||
| 2041 | - if (IsSafeBrowsingEnabled(*pref.first)) { | ||
| 2042 | - enabled_by_prefs_ = true; | ||
| 2043 | - | ||
| 2044 | - ExtendedReportingLevel erl = | ||
| 2045 | - safe_browsing::GetExtendedReportingLevel(*pref.first); | ||
| 2046 | - if (erl != SBER_LEVEL_OFF) { | ||
| 2047 | - estimated_extended_reporting_by_prefs_ = erl; | ||
| 2048 | - } | ||
| 2049 | - } | ||
| 2050 | - } | ||
| 2051 | |||
| 2052 | if (enabled_by_prefs_) | ||
| 2053 | Start(); | ||
| 2054 | --- chrome/browser/safe_browsing/safe_browsing_service.h.orig | ||
| 2055 | +++ chrome/browser/safe_browsing/safe_browsing_service.h | ||
| 2056 | @@ -28,7 +28,6 @@ | ||
| 2057 | #include "components/safe_browsing/buildflags.h" | ||
| 2058 | #include "components/safe_browsing/content/browser/safe_browsing_service_interface.h" | ||
| 2059 | #include "components/safe_browsing/core/browser/db/util.h" | ||
| 2060 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 2061 | #include "content/public/browser/browser_context.h" | ||
| 2062 | #include "content/public/browser/browser_thread.h" | ||
| 2063 | #include "services/network/public/mojom/network_context.mojom-forward.h" | ||
| 2064 | @@ -97,15 +96,6 @@ class SafeBrowsingService : public SafeB | ||
| 2065 | // Called on the main thread to let us know that the io_thread is going away. | ||
| 2066 | void ShutDown(); | ||
| 2067 | |||
| 2068 | - // NOTE(vakh): This is not the most reliable way to find out if extended | ||
| 2069 | - // reporting has been enabled. That's why it starts with estimated_. It | ||
| 2070 | - // returns true if any of the profiles have extended reporting enabled. It may | ||
| 2071 | - // be called on any thread. That can lead to a race condition, but that's | ||
| 2072 | - // acceptable. | ||
| 2073 | - ExtendedReportingLevel estimated_extended_reporting_by_prefs() const { | ||
| 2074 | - return estimated_extended_reporting_by_prefs_; | ||
| 2075 | - } | ||
| 2076 | - | ||
| 2077 | // Get current enabled status. Must be called on IO thread. | ||
| 2078 | bool enabled() const { | ||
| 2079 | DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | ||
| 2080 | @@ -287,10 +277,6 @@ class SafeBrowsingService : public SafeB | ||
| 2081 | // Provides phishing and malware statistics. Accessed on UI thread. | ||
| 2082 | std::unique_ptr<PingManager> ping_manager_; | ||
| 2083 | |||
| 2084 | - // Whether SafeBrowsing Extended Reporting is enabled by the current set of | ||
| 2085 | - // profiles. Updated on the UI thread. | ||
| 2086 | - ExtendedReportingLevel estimated_extended_reporting_by_prefs_; | ||
| 2087 | - | ||
| 2088 | // Whether the service has been shutdown. | ||
| 2089 | bool shutdown_; | ||
| 2090 | |||
| 2091 | --- chrome/browser/safe_browsing/telemetry/android/android_telemetry_service.cc.orig | ||
| 2092 | +++ chrome/browser/safe_browsing/telemetry/android/android_telemetry_service.cc | ||
| 2093 | @@ -27,7 +27,6 @@ | ||
| 2094 | #include "components/safe_browsing/core/browser/db/database_manager.h" | ||
| 2095 | #include "components/safe_browsing/core/browser/ping_manager.h" | ||
| 2096 | #include "components/safe_browsing/core/common/features.h" | ||
| 2097 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 2098 | #include "content/public/browser/browser_task_traits.h" | ||
| 2099 | #include "content/public/browser/browser_thread.h" | ||
| 2100 | #include "content/public/browser/download_item_utils.h" | ||
| 2101 | @@ -142,11 +141,9 @@ bool AndroidTelemetryService::CanSendPin | ||
| 2102 | return false; | ||
| 2103 | } | ||
| 2104 | |||
| 2105 | - if (!IsSafeBrowsingEnabled(*GetPrefs())) { | ||
| 2106 | - RecordApkDownloadTelemetryOutcome( | ||
| 2107 | - ApkDownloadTelemetryOutcome::NOT_SENT_SAFE_BROWSING_NOT_ENABLED); | ||
| 2108 | - return false; | ||
| 2109 | - } | ||
| 2110 | + RecordApkDownloadTelemetryOutcome( | ||
| 2111 | + ApkDownloadTelemetryOutcome::NOT_SENT_SAFE_BROWSING_NOT_ENABLED); | ||
| 2112 | + return false; | ||
| 2113 | |||
| 2114 | if (profile_->IsOffTheRecord()) { | ||
| 2115 | RecordApkDownloadTelemetryOutcome( | ||
| 2116 | --- chrome/browser/safe_browsing/telemetry/android/android_telemetry_service_unittest.cc.orig | ||
| 2117 | +++ chrome/browser/safe_browsing/telemetry/android/android_telemetry_service_unittest.cc | ||
| 2118 | @@ -18,7 +18,6 @@ | ||
| 2119 | #include "components/download/public/common/mock_download_item.h" | ||
| 2120 | #include "components/prefs/pref_service.h" | ||
| 2121 | #include "components/safe_browsing/core/common/features.h" | ||
| 2122 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 2123 | #include "content/public/browser/browser_task_traits.h" | ||
| 2124 | #include "content/public/browser/browser_thread.h" | ||
| 2125 | #include "content/public/browser/download_item_utils.h" | ||
| 2126 | --- chrome/browser/safe_browsing/url_checker_delegate_impl.cc.orig | ||
| 2127 | +++ chrome/browser/safe_browsing/url_checker_delegate_impl.cc | ||
| 2128 | @@ -21,7 +21,6 @@ | ||
| 2129 | #include "components/safe_browsing/core/browser/db/database_manager.h" | ||
| 2130 | #include "components/safe_browsing/core/browser/db/v4_protocol_manager_util.h" | ||
| 2131 | #include "components/safe_browsing/core/common/features.h" | ||
| 2132 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 2133 | #include "components/security_interstitials/content/unsafe_resource_util.h" | ||
| 2134 | #include "content/public/browser/browser_task_traits.h" | ||
| 2135 | #include "content/public/browser/browser_thread.h" | ||
| 2136 | --- chrome/browser/signin/account_consistency_mode_manager.cc.orig | ||
| 2137 | +++ chrome/browser/signin/account_consistency_mode_manager.cc | ||
| 2138 | @@ -19,7 +19,6 @@ | ||
| 2139 | #include "components/pref_registry/pref_registry_syncable.h" | ||
| 2140 | #include "components/prefs/pref_service.h" | ||
| 2141 | #include "components/signin/public/base/signin_buildflags.h" | ||
| 2142 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2143 | #include "google_apis/google_api_keys.h" | ||
| 2144 | |||
| 2145 | #if BUILDFLAG(IS_CHROMEOS_ASH) | ||
| 2146 | @@ -98,7 +97,6 @@ AccountConsistencyModeManager::AccountCo | ||
| 2147 | // pref. | ||
| 2148 | bool signin_allowed = IsDiceSignInAllowed() && | ||
| 2149 | prefs->GetBoolean(prefs::kSigninAllowedOnNextStartup); | ||
| 2150 | - prefs->SetBoolean(prefs::kSigninAllowed, signin_allowed); | ||
| 2151 | |||
| 2152 | UMA_HISTOGRAM_BOOLEAN("Signin.SigninAllowed", signin_allowed); | ||
| 2153 | #endif | ||
| 2154 | @@ -196,16 +194,7 @@ AccountConsistencyModeManager::ComputeAc | ||
| 2155 | // AccountManager is not available, when DICE has been disabled on Lacros. | ||
| 2156 | #endif | ||
| 2157 | |||
| 2158 | -#if BUILDFLAG(ENABLE_DICE_SUPPORT) | ||
| 2159 | - if (!profile->GetPrefs()->GetBoolean(prefs::kSigninAllowed)) { | ||
| 2160 | VLOG(1) << "Desktop Identity Consistency disabled as sign-in to Chrome" | ||
| 2161 | "is not allowed"; | ||
| 2162 | - return AccountConsistencyMethod::kDisabled; | ||
| 2163 | - } | ||
| 2164 | - | ||
| 2165 | - return AccountConsistencyMethod::kDice; | ||
| 2166 | -#endif | ||
| 2167 | - | ||
| 2168 | - NOTREACHED(); | ||
| 2169 | return AccountConsistencyMethod::kDisabled; | ||
| 2170 | } | ||
| 2171 | --- chrome/browser/signin/account_consistency_mode_manager_unittest.cc.orig | ||
| 2172 | +++ chrome/browser/signin/account_consistency_mode_manager_unittest.cc | ||
| 2173 | @@ -20,7 +20,6 @@ | ||
| 2174 | #include "components/prefs/testing_pref_store.h" | ||
| 2175 | #include "components/signin/public/base/account_consistency_method.h" | ||
| 2176 | #include "components/signin/public/base/signin_buildflags.h" | ||
| 2177 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2178 | #include "components/sync_preferences/testing_pref_service_syncable.h" | ||
| 2179 | #include "content/public/test/browser_task_environment.h" | ||
| 2180 | #include "testing/gtest/include/gtest/gtest.h" | ||
| 2181 | --- chrome/browser/signin/chrome_device_id_helper.cc.orig | ||
| 2182 | +++ chrome/browser/signin/chrome_device_id_helper.cc | ||
| 2183 | @@ -16,7 +16,6 @@ | ||
| 2184 | #include "base/logging.h" | ||
| 2185 | #include "chrome/browser/ash/profiles/profile_helper.h" | ||
| 2186 | #include "components/prefs/pref_service.h" | ||
| 2187 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2188 | #include "components/signin/public/base/signin_switches.h" | ||
| 2189 | #include "components/user_manager/known_user.h" | ||
| 2190 | #include "components/user_manager/user_manager.h" | ||
| 2191 | @@ -67,21 +66,11 @@ void MigrateSigninScopedDeviceId(Profile | ||
| 2192 | return; | ||
| 2193 | const AccountId account_id = user->GetAccountId(); | ||
| 2194 | if (user_manager::known_user::GetDeviceId(account_id).empty()) { | ||
| 2195 | - const std::string legacy_device_id = profile->GetPrefs()->GetString( | ||
| 2196 | - prefs::kGoogleServicesSigninScopedDeviceId); | ||
| 2197 | - if (!legacy_device_id.empty()) { | ||
| 2198 | - // Need to move device ID from the old location to the new one, if it has | ||
| 2199 | - // not been done yet. | ||
| 2200 | - user_manager::known_user::SetDeviceId(account_id, legacy_device_id); | ||
| 2201 | - } else { | ||
| 2202 | - user_manager::known_user::SetDeviceId( | ||
| 2203 | - account_id, GenerateSigninScopedDeviceId( | ||
| 2204 | - user_manager::UserManager::Get() | ||
| 2205 | - ->IsUserNonCryptohomeDataEphemeral(account_id))); | ||
| 2206 | - } | ||
| 2207 | + user_manager::known_user::SetDeviceId( | ||
| 2208 | + account_id, GenerateSigninScopedDeviceId( | ||
| 2209 | + user_manager::UserManager::Get() | ||
| 2210 | + ->IsUserNonCryptohomeDataEphemeral(account_id))); | ||
| 2211 | } | ||
| 2212 | - profile->GetPrefs()->SetString(prefs::kGoogleServicesSigninScopedDeviceId, | ||
| 2213 | - std::string()); | ||
| 2214 | } | ||
| 2215 | |||
| 2216 | #endif | ||
| 2217 | --- chrome/browser/signin/chrome_signin_client.cc.orig | ||
| 2218 | +++ chrome/browser/signin/chrome_signin_client.cc | ||
| 2219 | @@ -38,7 +38,6 @@ | ||
| 2220 | #include "components/prefs/pref_service.h" | ||
| 2221 | #include "components/signin/core/browser/cookie_settings_util.h" | ||
| 2222 | #include "components/signin/public/base/signin_buildflags.h" | ||
| 2223 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2224 | #include "components/signin/public/identity_manager/access_token_info.h" | ||
| 2225 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 2226 | #include "components/signin/public/identity_manager/scope_set.h" | ||
| 2227 | --- chrome/browser/signin/chromeos_mirror_account_consistency_browsertest.cc.orig | ||
| 2228 | +++ chrome/browser/signin/chromeos_mirror_account_consistency_browsertest.cc | ||
| 2229 | @@ -21,7 +21,6 @@ | ||
| 2230 | #include "components/network_session_configurator/common/network_switches.h" | ||
| 2231 | #include "components/prefs/pref_service.h" | ||
| 2232 | #include "components/signin/core/browser/signin_header_helper.h" | ||
| 2233 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2234 | #include "components/signin/public/identity_manager/identity_test_utils.h" | ||
| 2235 | #include "components/user_manager/user.h" | ||
| 2236 | #include "components/user_manager/user_manager.h" | ||
| 2237 | --- chrome/browser/signin/dice_browsertest.cc.orig | ||
| 2238 | +++ chrome/browser/signin/dice_browsertest.cc | ||
| 2239 | @@ -59,7 +59,6 @@ | ||
| 2240 | #include "components/signin/public/base/account_consistency_method.h" | ||
| 2241 | #include "components/signin/public/base/signin_client.h" | ||
| 2242 | #include "components/signin/public/base/signin_metrics.h" | ||
| 2243 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2244 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 2245 | #include "components/signin/public/identity_manager/identity_test_utils.h" | ||
| 2246 | #include "components/signin/public/identity_manager/primary_account_mutator.h" | ||
| 2247 | --- chrome/browser/signin/header_modification_delegate_impl.cc.orig | ||
| 2248 | +++ chrome/browser/signin/header_modification_delegate_impl.cc | ||
| 2249 | @@ -15,7 +15,6 @@ | ||
| 2250 | #include "chrome/browser/sync/sync_service_factory.h" | ||
| 2251 | #include "chrome/common/pref_names.h" | ||
| 2252 | #include "components/prefs/pref_service.h" | ||
| 2253 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2254 | #include "components/signin/public/identity_manager/account_info.h" | ||
| 2255 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 2256 | #include "components/signin/public/identity_manager/tribool.h" | ||
| 2257 | @@ -113,7 +112,7 @@ void HeaderModificationDelegateImpl::Pro | ||
| 2258 | #endif | ||
| 2259 | #if BUILDFLAG(ENABLE_DICE_SUPPORT) | ||
| 2260 | sync_service && sync_service->IsSyncFeatureEnabled(), | ||
| 2261 | - prefs->GetString(prefs::kGoogleServicesSigninScopedDeviceId), | ||
| 2262 | + std::string(), | ||
| 2263 | #endif | ||
| 2264 | cookie_settings_.get()); | ||
| 2265 | } | ||
| 2266 | --- chrome/browser/signin/mirror_browsertest.cc.orig | ||
| 2267 | +++ chrome/browser/signin/mirror_browsertest.cc | ||
| 2268 | @@ -31,7 +31,6 @@ | ||
| 2269 | #include "components/prefs/pref_service.h" | ||
| 2270 | #include "components/signin/core/browser/dice_header_helper.h" | ||
| 2271 | #include "components/signin/core/browser/signin_header_helper.h" | ||
| 2272 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2273 | #include "content/public/common/content_client.h" | ||
| 2274 | #include "content/public/test/browser_test.h" | ||
| 2275 | #include "google_apis/gaia/gaia_urls.h" | ||
| 2276 | --- chrome/browser/signin/signin_manager.cc.orig | ||
| 2277 | +++ chrome/browser/signin/signin_manager.cc | ||
| 2278 | @@ -5,7 +5,6 @@ | ||
| 2279 | #include "chrome/browser/signin/signin_manager.h" | ||
| 2280 | |||
| 2281 | #include "components/prefs/pref_service.h" | ||
| 2282 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2283 | #include "components/signin/public/identity_manager/accounts_in_cookie_jar_info.h" | ||
| 2284 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 2285 | #include "components/signin/public/identity_manager/primary_account_mutator.h" | ||
| 2286 | @@ -13,11 +12,6 @@ | ||
| 2287 | SigninManager::SigninManager(PrefService* prefs, | ||
| 2288 | signin::IdentityManager* identity_manager) | ||
| 2289 | : prefs_(prefs), identity_manager_(identity_manager) { | ||
| 2290 | - signin_allowed_.Init( | ||
| 2291 | - prefs::kSigninAllowed, prefs_, | ||
| 2292 | - base::BindRepeating(&SigninManager::OnSigninAllowedPrefChanged, | ||
| 2293 | - base::Unretained(this))); | ||
| 2294 | - | ||
| 2295 | UpdateUnconsentedPrimaryAccount(); | ||
| 2296 | identity_manager_->AddObserver(this); | ||
| 2297 | } | ||
| 2298 | @@ -63,16 +57,6 @@ SigninManager::ComputeUnconsentedPrimary | ||
| 2299 | signin::ConsentLevel::kSync); | ||
| 2300 | } | ||
| 2301 | |||
| 2302 | - // Clearing the primary sync account when sign-in is not allowed is handled | ||
| 2303 | - // by PrimaryAccountPolicyManager. That flow is extremely hard to follow | ||
| 2304 | - // especially for the case when the user is syncing with a managed account | ||
| 2305 | - // as in that case the whole profile needs to be deleted. | ||
| 2306 | - // | ||
| 2307 | - // It was considered simpler to keep the logic to update the unconsented | ||
| 2308 | - // primary account in a single place. | ||
| 2309 | - if (!signin_allowed_.GetValue()) | ||
| 2310 | - return absl::nullopt; | ||
| 2311 | - | ||
| 2312 | signin::AccountsInCookieJarInfo cookie_info = | ||
| 2313 | identity_manager_->GetAccountsInCookieJar(); | ||
| 2314 | |||
| 2315 | --- chrome/browser/signin/signin_promo_util.cc.orig | ||
| 2316 | +++ chrome/browser/signin/signin_promo_util.cc | ||
| 2317 | @@ -8,7 +8,6 @@ | ||
| 2318 | #include "chrome/browser/profiles/profile.h" | ||
| 2319 | #include "chrome/browser/signin/identity_manager_factory.h" | ||
| 2320 | #include "components/prefs/pref_service.h" | ||
| 2321 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2322 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 2323 | #include "components/signin/public/identity_manager/primary_account_mutator.h" | ||
| 2324 | #include "net/base/network_change_notifier.h" | ||
| 2325 | @@ -36,7 +35,7 @@ bool ShouldShowPromo(Profile* profile) { | ||
| 2326 | return false; | ||
| 2327 | |||
| 2328 | // Don't show if sign-in is not allowed. | ||
| 2329 | - if (!original_profile->GetPrefs()->GetBoolean(prefs::kSigninAllowed)) | ||
| 2330 | + if (true) | ||
| 2331 | return false; | ||
| 2332 | |||
| 2333 | // Display the signin promo if the user is not signed in. | ||
| 2334 | --- chrome/browser/signin/signin_ui_util.cc.orig | ||
| 2335 | +++ chrome/browser/signin/signin_ui_util.cc | ||
| 2336 | @@ -34,7 +34,6 @@ | ||
| 2337 | #include "components/feature_engagement/public/tracker.h" | ||
| 2338 | #include "components/prefs/pref_service.h" | ||
| 2339 | #include "components/signin/public/base/signin_metrics.h" | ||
| 2340 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2341 | #include "components/signin/public/identity_manager/account_info.h" | ||
| 2342 | #include "components/signin/public/identity_manager/accounts_in_cookie_jar_info.h" | ||
| 2343 | #include "components/signin/public/identity_manager/consent_level.h" | ||
| 2344 | --- chrome/browser/signin/signin_util.cc.orig | ||
| 2345 | +++ chrome/browser/signin/signin_util.cc | ||
| 2346 | @@ -30,7 +30,6 @@ | ||
| 2347 | #include "components/google/core/common/google_util.h" | ||
| 2348 | #include "components/prefs/pref_service.h" | ||
| 2349 | #include "components/signin/public/base/signin_metrics.h" | ||
| 2350 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2351 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 2352 | #include "components/signin/public/identity_manager/identity_utils.h" | ||
| 2353 | #include "components/signin/public/identity_manager/primary_account_mutator.h" | ||
| 2354 | @@ -232,7 +231,7 @@ void EnsurePrimaryAccountAllowedForProfi | ||
| 2355 | |||
| 2356 | CoreAccountInfo primary_account = | ||
| 2357 | identity_manager->GetPrimaryAccountInfo(signin::ConsentLevel::kSync); | ||
| 2358 | - if (profile->GetPrefs()->GetBoolean(prefs::kSigninAllowed) && | ||
| 2359 | + if (false && | ||
| 2360 | signin::IsUsernameAllowedByPatternFromPrefs( | ||
| 2361 | g_browser_process->local_state(), primary_account.email)) { | ||
| 2362 | return; | ||
| 2363 | --- chrome/browser/signin/signin_util_win.cc.orig | ||
| 2364 | +++ chrome/browser/signin/signin_util_win.cc | ||
| 2365 | @@ -34,7 +34,6 @@ | ||
| 2366 | #include "components/prefs/pref_service.h" | ||
| 2367 | #include "components/signin/core/browser/about_signin_internals.h" | ||
| 2368 | #include "components/signin/public/base/signin_metrics.h" | ||
| 2369 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2370 | #include "components/signin/public/identity_manager/accounts_mutator.h" | ||
| 2371 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 2372 | |||
| 2373 | @@ -136,9 +135,6 @@ void ImportCredentialsFromProvider(Profi | ||
| 2374 | account_id, nullptr)); | ||
| 2375 | } | ||
| 2376 | } | ||
| 2377 | - | ||
| 2378 | - // Mark this profile as having been signed in with the credential provider. | ||
| 2379 | - profile->GetPrefs()->SetBoolean(prefs::kSignedInWithCredentialProvider, true); | ||
| 2380 | } | ||
| 2381 | |||
| 2382 | // Extracts the |cred_provider_gaia_id| and |cred_provider_email| for the user | ||
| 2383 | @@ -313,20 +309,7 @@ bool ReauthWithCredentialProviderIfPossi | ||
| 2384 | // - The profile is marked as having been signed in with a system credential. | ||
| 2385 | // - The profile is already signed in. | ||
| 2386 | // - The profile is in an auth error state. | ||
| 2387 | - auto* identity_manager = IdentityManagerFactory::GetForProfile(profile); | ||
| 2388 | - if (!(profile->GetPrefs()->GetBoolean( | ||
| 2389 | - prefs::kSignedInWithCredentialProvider) && | ||
| 2390 | - identity_manager->HasPrimaryAccount(signin::ConsentLevel::kSync) && | ||
| 2391 | - identity_manager->HasAccountWithRefreshTokenInPersistentErrorState( | ||
| 2392 | - identity_manager->GetPrimaryAccountId( | ||
| 2393 | - signin::ConsentLevel::kSync)))) { | ||
| 2394 | return false; | ||
| 2395 | - } | ||
| 2396 | - | ||
| 2397 | - std::wstring gaia_id = base::UTF8ToWide( | ||
| 2398 | - identity_manager->GetPrimaryAccountInfo(signin::ConsentLevel::kSync) | ||
| 2399 | - .gaia.c_str()); | ||
| 2400 | - return TrySigninWithCredentialProvider(profile, gaia_id, false); | ||
| 2401 | } | ||
| 2402 | |||
| 2403 | } // namespace signin_util | ||
| 2404 | --- chrome/browser/signin/signin_util_win_browsertest.cc.orig | ||
| 2405 | +++ chrome/browser/signin/signin_util_win_browsertest.cc | ||
| 2406 | @@ -31,7 +31,6 @@ | ||
| 2407 | #include "chrome/test/base/in_process_browser_test.h" | ||
| 2408 | #include "chrome/test/base/testing_browser_process.h" | ||
| 2409 | #include "components/prefs/pref_service.h" | ||
| 2410 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2411 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 2412 | #include "components/signin/public/identity_manager/identity_test_utils.h" | ||
| 2413 | #include "components/signin/public/identity_manager/primary_account_mutator.h" | ||
| 2414 | --- chrome/browser/ssl/certificate_reporting_test_utils.cc.orig | ||
| 2415 | +++ chrome/browser/ssl/certificate_reporting_test_utils.cc | ||
| 2416 | @@ -15,7 +15,6 @@ | ||
| 2417 | #include "build/build_config.h" | ||
| 2418 | #include "chrome/browser/profiles/profile.h" | ||
| 2419 | #include "components/prefs/pref_service.h" | ||
| 2420 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 2421 | #include "components/security_interstitials/content/cert_report_helper.h" | ||
| 2422 | #include "components/security_interstitials/content/certificate_error_report.h" | ||
| 2423 | #include "components/variations/variations_associated_data.h" | ||
| 2424 | --- chrome/browser/ssl/sct_reporting_service.cc.orig | ||
| 2425 | +++ chrome/browser/ssl/sct_reporting_service.cc | ||
| 2426 | @@ -9,7 +9,6 @@ | ||
| 2427 | #include "chrome/browser/net/system_network_context_manager.h" | ||
| 2428 | #include "chrome/browser/safe_browsing/safe_browsing_service.h" | ||
| 2429 | #include "chrome/common/chrome_features.h" | ||
| 2430 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 2431 | #include "content/public/browser/network_service_instance.h" | ||
| 2432 | #include "content/public/browser/storage_partition.h" | ||
| 2433 | #include "net/traffic_annotation/network_traffic_annotation.h" | ||
| 2434 | @@ -119,8 +118,5 @@ void SCTReportingService::SetReportingEn | ||
| 2435 | } | ||
| 2436 | |||
| 2437 | void SCTReportingService::OnPreferenceChanged() { | ||
| 2438 | - const bool enabled = safe_browsing_service_ && | ||
| 2439 | - safe_browsing_service_->enabled_by_prefs() && | ||
| 2440 | - safe_browsing::IsExtendedReportingEnabled(pref_service_); | ||
| 2441 | - SetReportingEnabled(enabled); | ||
| 2442 | + SetReportingEnabled(false); | ||
| 2443 | } | ||
| 2444 | --- chrome/browser/ssl/ssl_browsertest.cc.orig | ||
| 2445 | +++ chrome/browser/ssl/ssl_browsertest.cc | ||
| 2446 | @@ -94,7 +94,6 @@ | ||
| 2447 | #include "components/policy/policy_constants.h" | ||
| 2448 | #include "components/prefs/testing_pref_service.h" | ||
| 2449 | #include "components/safe_browsing/core/common/features.h" | ||
| 2450 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 2451 | #include "components/security_interstitials/content/bad_clock_blocking_page.h" | ||
| 2452 | #include "components/security_interstitials/content/captive_portal_blocking_page.h" | ||
| 2453 | #include "components/security_interstitials/content/cert_report_helper.h" | ||
| 2454 | --- chrome/browser/ssl/ssl_error_controller_client.cc.orig | ||
| 2455 | +++ chrome/browser/ssl/ssl_error_controller_client.cc | ||
| 2456 | @@ -23,7 +23,6 @@ | ||
| 2457 | #include "chrome/browser/ssl/stateful_ssl_host_state_delegate_factory.h" | ||
| 2458 | #include "chrome/common/pref_names.h" | ||
| 2459 | #include "chrome/common/url_constants.h" | ||
| 2460 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 2461 | #include "components/security_interstitials/content/content_metrics_helper.h" | ||
| 2462 | #include "components/security_interstitials/content/settings_page_helper.h" | ||
| 2463 | #include "components/security_interstitials/content/stateful_ssl_host_state_delegate.h" | ||
| 2464 | --- chrome/browser/supervised_user/supervised_user_pref_store.cc.orig | ||
| 2465 | +++ chrome/browser/supervised_user/supervised_user_pref_store.cc | ||
| 2466 | @@ -23,7 +23,6 @@ | ||
| 2467 | #include "chrome/common/pref_names.h" | ||
| 2468 | #include "components/feed/core/shared_prefs/pref_names.h" | ||
| 2469 | #include "components/prefs/pref_value_map.h" | ||
| 2470 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2471 | #include "extensions/buildflags/buildflags.h" | ||
| 2472 | |||
| 2473 | namespace { | ||
| 2474 | @@ -55,10 +54,6 @@ SupervisedUserSettingsPrefMappingEntry k | ||
| 2475 | prefs::kSupervisedUserSafeSites, | ||
| 2476 | }, | ||
| 2477 | { | ||
| 2478 | - supervised_users::kSigninAllowed, | ||
| 2479 | - prefs::kSigninAllowed, | ||
| 2480 | - }, | ||
| 2481 | - { | ||
| 2482 | supervised_users::kUserName, | ||
| 2483 | prefs::kProfileName, | ||
| 2484 | }, | ||
| 2485 | @@ -124,7 +119,6 @@ void SupervisedUserPrefStore::OnNewSetti | ||
| 2486 | prefs_->SetInteger(prefs::kForceYouTubeRestrict, | ||
| 2487 | safe_search_util::YOUTUBE_RESTRICT_MODERATE); | ||
| 2488 | prefs_->SetBoolean(prefs::kHideWebStoreIcon, false); | ||
| 2489 | - prefs_->SetBoolean(prefs::kSigninAllowed, false); | ||
| 2490 | prefs_->SetBoolean(feed::prefs::kEnableSnippets, false); | ||
| 2491 | |||
| 2492 | // Copy supervised user settings to prefs. | ||
| 2493 | --- chrome/browser/ui/autofill/payments/save_card_bubble_controller_impl.cc.orig | ||
| 2494 | +++ chrome/browser/ui/autofill/payments/save_card_bubble_controller_impl.cc | ||
| 2495 | @@ -37,7 +37,6 @@ | ||
| 2496 | #include "components/autofill/core/common/autofill_features.h" | ||
| 2497 | #include "components/autofill/core/common/autofill_payments_features.h" | ||
| 2498 | #include "components/signin/public/base/signin_buildflags.h" | ||
| 2499 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2500 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 2501 | #include "components/strings/grit/components_strings.h" | ||
| 2502 | #include "components/sync/driver/sync_service.h" | ||
| 2503 | --- chrome/browser/ui/browser_command_controller.cc.orig | ||
| 2504 | +++ chrome/browser/ui/browser_command_controller.cc | ||
| 2505 | @@ -57,7 +57,6 @@ | ||
| 2506 | #include "components/prefs/pref_service.h" | ||
| 2507 | #include "components/sessions/core/tab_restore_service.h" | ||
| 2508 | #include "components/signin/public/base/signin_buildflags.h" | ||
| 2509 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2510 | #include "content/public/browser/native_web_keyboard_event.h" | ||
| 2511 | #include "content/public/browser/navigation_controller.h" | ||
| 2512 | #include "content/public/browser/navigation_entry.h" | ||
| 2513 | @@ -184,10 +183,6 @@ BrowserCommandController::BrowserCommand | ||
| 2514 | &BrowserCommandController::UpdateCommandsForFullscreenMode, | ||
| 2515 | base::Unretained(this))); | ||
| 2516 | #endif | ||
| 2517 | - pref_signin_allowed_.Init( | ||
| 2518 | - prefs::kSigninAllowed, profile()->GetOriginalProfile()->GetPrefs(), | ||
| 2519 | - base::BindRepeating(&BrowserCommandController::OnSigninAllowedPrefChange, | ||
| 2520 | - base::Unretained(this))); | ||
| 2521 | |||
| 2522 | InitCommandState(); | ||
| 2523 | |||
| 2524 | @@ -1526,7 +1521,7 @@ void BrowserCommandController::UpdateSho | ||
| 2525 | return; | ||
| 2526 | |||
| 2527 | command_updater_.UpdateCommandEnabled( | ||
| 2528 | - IDC_SHOW_SIGNIN, show_main_ui && pref_signin_allowed_.GetValue()); | ||
| 2529 | + IDC_SHOW_SIGNIN, false); | ||
| 2530 | } | ||
| 2531 | |||
| 2532 | // static | ||
| 2533 | --- chrome/browser/ui/browser_command_controller.h.orig | ||
| 2534 | +++ chrome/browser/ui/browser_command_controller.h | ||
| 2535 | @@ -211,7 +211,6 @@ class BrowserCommandController : public | ||
| 2536 | |||
| 2537 | PrefChangeRegistrar profile_pref_registrar_; | ||
| 2538 | PrefChangeRegistrar local_pref_registrar_; | ||
| 2539 | - BooleanPrefMember pref_signin_allowed_; | ||
| 2540 | |||
| 2541 | // In locked fullscreen mode disallow enabling/disabling commands. | ||
| 2542 | bool is_locked_fullscreen_ = false; | ||
| 2543 | --- chrome/browser/ui/browser_command_controller_unittest.cc.orig | ||
| 2544 | +++ chrome/browser/ui/browser_command_controller_unittest.cc | ||
| 2545 | @@ -27,7 +27,6 @@ | ||
| 2546 | #include "chrome/test/base/test_browser_window.h" | ||
| 2547 | #include "chrome/test/base/testing_browser_process.h" | ||
| 2548 | #include "chrome/test/base/testing_profile_manager.h" | ||
| 2549 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2550 | #include "content/public/browser/native_web_keyboard_event.h" | ||
| 2551 | #include "ui/events/keycodes/dom/dom_code.h" | ||
| 2552 | #include "ui/events/keycodes/keyboard_codes.h" | ||
| 2553 | --- chrome/browser/ui/chrome_pages.cc.orig | ||
| 2554 | +++ chrome/browser/ui/chrome_pages.cc | ||
| 2555 | @@ -61,7 +61,6 @@ | ||
| 2556 | |||
| 2557 | #if !defined(OS_ANDROID) | ||
| 2558 | #include "chrome/browser/signin/identity_manager_factory.h" | ||
| 2559 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2560 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 2561 | #endif | ||
| 2562 | |||
| 2563 | @@ -484,13 +483,7 @@ void ShowBrowserSignin(Browser* browser, | ||
| 2564 | |||
| 2565 | void ShowBrowserSigninOrSettings(Browser* browser, | ||
| 2566 | signin_metrics::AccessPoint access_point) { | ||
| 2567 | - Profile* original_profile = browser->profile()->GetOriginalProfile(); | ||
| 2568 | - DCHECK(original_profile->GetPrefs()->GetBoolean(prefs::kSigninAllowed)); | ||
| 2569 | - if (IdentityManagerFactory::GetForProfile(original_profile) | ||
| 2570 | - ->HasPrimaryAccount(signin::ConsentLevel::kSync)) | ||
| 2571 | - ShowSettings(browser); | ||
| 2572 | - else | ||
| 2573 | - ShowBrowserSignin(browser, access_point, signin::ConsentLevel::kSync); | ||
| 2574 | + ShowSettings(browser); | ||
| 2575 | } | ||
| 2576 | #endif | ||
| 2577 | |||
| 2578 | --- chrome/browser/ui/hats/trust_safety_sentiment_service.cc.orig | ||
| 2579 | +++ chrome/browser/ui/hats/trust_safety_sentiment_service.cc | ||
| 2580 | @@ -19,8 +19,6 @@ | ||
| 2581 | #include "components/content_settings/core/common/pref_names.h" | ||
| 2582 | #include "components/password_manager/core/common/password_manager_pref_names.h" | ||
| 2583 | #include "components/prefs/pref_service.h" | ||
| 2584 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 2585 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2586 | #include "components/unified_consent/pref_names.h" | ||
| 2587 | |||
| 2588 | namespace { | ||
| 2589 | @@ -81,9 +79,6 @@ bool HasNonDefaultPrivacySetting(Profile | ||
| 2590 | auto* prefs = profile->GetPrefs(); | ||
| 2591 | |||
| 2592 | std::vector<std::string> prefs_to_check = { | ||
| 2593 | - prefs::kSafeBrowsingEnabled, | ||
| 2594 | - prefs::kSafeBrowsingEnhanced, | ||
| 2595 | - prefs::kSafeBrowsingScoutReportingEnabled, | ||
| 2596 | prefs::kEnableDoNotTrack, | ||
| 2597 | password_manager::prefs::kPasswordLeakDetectionEnabled, | ||
| 2598 | prefs::kCookieControlsMode, | ||
| 2599 | @@ -101,13 +96,9 @@ bool HasNonDefaultPrivacySetting(Profile | ||
| 2600 | // Users consenting to sync automatically enable UKM collection | ||
| 2601 | auto* ukm_pref = prefs->FindPreference( | ||
| 2602 | unified_consent::prefs::kUrlKeyedAnonymizedDataCollectionEnabled); | ||
| 2603 | - auto* sync_consent_pref = | ||
| 2604 | - prefs->FindPreference(prefs::kGoogleServicesConsentedToSync); | ||
| 2605 | |||
| 2606 | bool has_non_default_ukm = | ||
| 2607 | - ukm_pref->GetValue()->GetBool() != | ||
| 2608 | - sync_consent_pref->GetValue()->GetBool() && | ||
| 2609 | - (ukm_pref->IsUserControlled() || sync_consent_pref->IsUserControlled()); | ||
| 2610 | + ukm_pref->GetValue()->GetBool() != false && ukm_pref->IsUserControlled(); | ||
| 2611 | |||
| 2612 | // Check the default value for each user facing content setting. Note that | ||
| 2613 | // this will not include content setting exceptions set via permission | ||
| 2614 | --- chrome/browser/ui/views/page_info/page_info_bubble_view_sync_browsertest.cc.orig | ||
| 2615 | +++ chrome/browser/ui/views/page_info/page_info_bubble_view_sync_browsertest.cc | ||
| 2616 | @@ -20,7 +20,6 @@ | ||
| 2617 | #include "components/password_manager/core/browser/password_manager_metrics_util.h" | ||
| 2618 | #include "components/safe_browsing/content/browser/password_protection/password_protection_test_util.h" | ||
| 2619 | #include "components/safe_browsing/core/browser/password_protection/metrics_util.h" | ||
| 2620 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2621 | #include "components/signin/public/identity_manager/account_info.h" | ||
| 2622 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 2623 | #include "components/signin/public/identity_manager/identity_test_utils.h" | ||
| 2624 | --- chrome/browser/ui/views/profiles/profile_menu_view.cc.orig | ||
| 2625 | +++ chrome/browser/ui/views/profiles/profile_menu_view.cc | ||
| 2626 | @@ -53,7 +53,6 @@ | ||
| 2627 | #include "chrome/grit/generated_resources.h" | ||
| 2628 | #include "chrome/grit/theme_resources.h" | ||
| 2629 | #include "components/signin/core/browser/signin_error_controller.h" | ||
| 2630 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2631 | #include "components/signin/public/identity_manager/consent_level.h" | ||
| 2632 | #include "components/signin/public/identity_manager/primary_account_mutator.h" | ||
| 2633 | #include "components/strings/grit/components_strings.h" | ||
| 2634 | @@ -501,7 +500,6 @@ void ProfileMenuView::BuildAutofillButto | ||
| 2635 | |||
| 2636 | void ProfileMenuView::BuildSyncInfo() { | ||
| 2637 | Profile* profile = browser()->profile(); | ||
| 2638 | - if (!profile->GetPrefs()->GetBoolean(prefs::kSigninAllowed)) | ||
| 2639 | return; | ||
| 2640 | |||
| 2641 | signin::IdentityManager* identity_manager = | ||
| 2642 | --- chrome/browser/ui/views/profiles/profile_menu_view_browsertest.cc.orig | ||
| 2643 | +++ chrome/browser/ui/views/profiles/profile_menu_view_browsertest.cc | ||
| 2644 | @@ -55,7 +55,6 @@ | ||
| 2645 | #include "components/feature_engagement/public/tracker.h" | ||
| 2646 | #include "components/feature_engagement/test/test_tracker.h" | ||
| 2647 | #include "components/prefs/pref_service.h" | ||
| 2648 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2649 | #include "components/signin/public/identity_manager/consent_level.h" | ||
| 2650 | #include "components/signin/public/identity_manager/identity_test_utils.h" | ||
| 2651 | #include "components/sync/driver/sync_service.h" | ||
| 2652 | --- chrome/browser/ui/views/safe_browsing/password_reuse_modal_warning_dialog.cc.orig | ||
| 2653 | +++ chrome/browser/ui/views/safe_browsing/password_reuse_modal_warning_dialog.cc | ||
| 2654 | @@ -122,7 +122,6 @@ PasswordReuseModalWarningDialog::Passwor | ||
| 2655 | OnWarningDone done_callback) | ||
| 2656 | : content::WebContentsObserver(web_contents), | ||
| 2657 | done_callback_(std::move(done_callback)), | ||
| 2658 | - service_(service), | ||
| 2659 | url_(web_contents->GetLastCommittedURL()), | ||
| 2660 | password_type_(password_type) { | ||
| 2661 | bool show_check_passwords = false; | ||
| 2662 | @@ -163,29 +162,13 @@ PasswordReuseModalWarningDialog::Passwor | ||
| 2663 | SetCancelCallback(make_done_callback(WarningAction::IGNORE_WARNING)); | ||
| 2664 | SetCloseCallback(make_done_callback(WarningAction::CLOSE)); | ||
| 2665 | |||
| 2666 | - // |service| maybe NULL in tests. | ||
| 2667 | - if (service_) | ||
| 2668 | - service_->AddObserver(this); | ||
| 2669 | - | ||
| 2670 | - if (password_type.account_type() == | ||
| 2671 | - ReusedPasswordAccountType::SAVED_PASSWORD) { | ||
| 2672 | - const std::u16string message_body = | ||
| 2673 | - service_->GetWarningDetailText(password_type); | ||
| 2674 | - | ||
| 2675 | - CreateSavedPasswordReuseModalWarningDialog(message_body); | ||
| 2676 | - } else { | ||
| 2677 | - views::Label* message_body_label = CreateMessageBodyLabel( | ||
| 2678 | - service_ | ||
| 2679 | - ? service_->GetWarningDetailText(password_type) | ||
| 2680 | - : l10n_util::GetStringUTF16(IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS)); | ||
| 2681 | - CreateGaiaPasswordReuseModalWarningDialog(message_body_label); | ||
| 2682 | - } | ||
| 2683 | + views::Label* message_body_label = CreateMessageBodyLabel( | ||
| 2684 | + l10n_util::GetStringUTF16(IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS)); | ||
| 2685 | + CreateGaiaPasswordReuseModalWarningDialog(message_body_label); | ||
| 2686 | modal_construction_start_time_ = base::TimeTicks::Now(); | ||
| 2687 | } | ||
| 2688 | |||
| 2689 | PasswordReuseModalWarningDialog::~PasswordReuseModalWarningDialog() { | ||
| 2690 | - if (service_) | ||
| 2691 | - service_->RemoveObserver(this); | ||
| 2692 | LogModalWarningDialogLifetime(modal_construction_start_time_); | ||
| 2693 | } | ||
| 2694 | |||
| 2695 | --- chrome/browser/ui/views/safe_browsing/password_reuse_modal_warning_dialog.h.orig | ||
| 2696 | +++ chrome/browser/ui/views/safe_browsing/password_reuse_modal_warning_dialog.h | ||
| 2697 | @@ -60,7 +60,6 @@ class PasswordReuseModalWarningDialog | ||
| 2698 | |||
| 2699 | private: | ||
| 2700 | OnWarningDone done_callback_; | ||
| 2701 | - ChromePasswordProtectionService* service_; | ||
| 2702 | const GURL url_; | ||
| 2703 | const ReusedPasswordAccountType password_type_; | ||
| 2704 | |||
| 2705 | --- chrome/browser/ui/views/sync/inline_login_ui_browsertest.cc.orig | ||
| 2706 | +++ chrome/browser/ui/views/sync/inline_login_ui_browsertest.cc | ||
| 2707 | @@ -44,7 +44,6 @@ | ||
| 2708 | #include "components/keyed_service/content/browser_context_dependency_manager.h" | ||
| 2709 | #include "components/prefs/pref_service.h" | ||
| 2710 | #include "components/prefs/scoped_user_pref_update.h" | ||
| 2711 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2712 | #include "components/signin/public/identity_manager/identity_test_utils.h" | ||
| 2713 | #include "content/public/browser/render_frame_host.h" | ||
| 2714 | #include "content/public/browser/render_process_host.h" | ||
| 2715 | --- chrome/browser/ui/webui/browser_command/browser_command_handler.cc.orig | ||
| 2716 | +++ chrome/browser/ui/webui/browser_command/browser_command_handler.cc | ||
| 2717 | @@ -16,7 +16,6 @@ | ||
| 2718 | #include "chrome/common/webui_url_constants.h" | ||
| 2719 | #include "components/safe_browsing/content/browser/web_ui/safe_browsing_ui.h" | ||
| 2720 | #include "components/safe_browsing/core/common/safe_browsing_policy_handler.h" | ||
| 2721 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 2722 | #include "ui/base/page_transition_types.h" | ||
| 2723 | #include "ui/base/window_open_disposition.h" | ||
| 2724 | |||
| 2725 | @@ -61,13 +60,6 @@ void BrowserCommandHandler::CanExecuteCo | ||
| 2726 | can_execute = | ||
| 2727 | !chrome::enterprise_util::HasBrowserPoliciesApplied(profile_); | ||
| 2728 | break; | ||
| 2729 | - case Command::kOpenSafeBrowsingEnhancedProtectionSettings: { | ||
| 2730 | - bool managed = safe_browsing::SafeBrowsingPolicyHandler:: | ||
| 2731 | - IsSafeBrowsingProtectionLevelSetByPolicy(profile_->GetPrefs()); | ||
| 2732 | - bool already_enabled = | ||
| 2733 | - safe_browsing::IsEnhancedProtectionEnabled(*(profile_->GetPrefs())); | ||
| 2734 | - can_execute = !managed && !already_enabled; | ||
| 2735 | - } break; | ||
| 2736 | case Command::kOpenFeedbackForm: | ||
| 2737 | can_execute = true; | ||
| 2738 | break; | ||
| 2739 | --- chrome/browser/ui/webui/downloads/downloads_dom_handler.cc.orig | ||
| 2740 | +++ chrome/browser/ui/webui/downloads/downloads_dom_handler.cc | ||
| 2741 | @@ -37,7 +37,6 @@ | ||
| 2742 | #include "chrome/common/url_constants.h" | ||
| 2743 | #include "components/download/public/common/download_item.h" | ||
| 2744 | #include "components/prefs/pref_service.h" | ||
| 2745 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 2746 | #include "content/public/browser/browser_thread.h" | ||
| 2747 | #include "content/public/browser/download_manager.h" | ||
| 2748 | #include "content/public/browser/render_process_host.h" | ||
| 2749 | --- chrome/browser/ui/webui/management/management_ui_handler.cc.orig | ||
| 2750 | +++ chrome/browser/ui/webui/management/management_ui_handler.cc | ||
| 2751 | @@ -29,7 +29,6 @@ | ||
| 2752 | #include "chrome/browser/profiles/profile.h" | ||
| 2753 | #include "chrome/browser/ui/managed_ui.h" | ||
| 2754 | #include "chrome/common/pref_names.h" | ||
| 2755 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 2756 | #include "components/strings/grit/components_strings.h" | ||
| 2757 | #include "content/public/browser/storage_partition.h" | ||
| 2758 | #include "content/public/browser/web_contents.h" | ||
| 2759 | --- chrome/browser/ui/webui/profile_info_watcher.cc.orig | ||
| 2760 | +++ chrome/browser/ui/webui/profile_info_watcher.cc | ||
| 2761 | @@ -12,7 +12,6 @@ | ||
| 2762 | #include "chrome/browser/signin/identity_manager_factory.h" | ||
| 2763 | #include "chrome/common/pref_names.h" | ||
| 2764 | #include "components/prefs/pref_service.h" | ||
| 2765 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2766 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 2767 | |||
| 2768 | ProfileInfoWatcher::ProfileInfoWatcher(Profile* profile, | ||
| 2769 | @@ -25,11 +24,6 @@ ProfileInfoWatcher::ProfileInfoWatcher(P | ||
| 2770 | // The profile_manager might be NULL in testing environments. | ||
| 2771 | if (profile_manager) | ||
| 2772 | profile_manager->GetProfileAttributesStorage().AddObserver(this); | ||
| 2773 | - | ||
| 2774 | - signin_allowed_pref_.Init( | ||
| 2775 | - prefs::kSigninAllowed, profile_->GetPrefs(), | ||
| 2776 | - base::BindRepeating(&ProfileInfoWatcher::RunCallback, | ||
| 2777 | - base::Unretained(this))); | ||
| 2778 | } | ||
| 2779 | |||
| 2780 | ProfileInfoWatcher::~ProfileInfoWatcher() { | ||
| 2781 | --- chrome/browser/ui/webui/profile_info_watcher.h.orig | ||
| 2782 | +++ chrome/browser/ui/webui/profile_info_watcher.h | ||
| 2783 | @@ -49,7 +49,6 @@ class ProfileInfoWatcher : public Profil | ||
| 2784 | // Called when the authenticated username changes. | ||
| 2785 | base::RepeatingClosure callback_; | ||
| 2786 | |||
| 2787 | - BooleanPrefMember signin_allowed_pref_; | ||
| 2788 | }; | ||
| 2789 | |||
| 2790 | #endif // CHROME_BROWSER_UI_WEBUI_PROFILE_INFO_WATCHER_H_ | ||
| 2791 | --- chrome/browser/ui/webui/reset_password/reset_password_ui.cc.orig | ||
| 2792 | +++ chrome/browser/ui/webui/reset_password/reset_password_ui.cc | ||
| 2793 | @@ -17,7 +17,6 @@ | ||
| 2794 | #include "components/safe_browsing/content/browser/password_protection/password_protection_service.h" | ||
| 2795 | #include "components/safe_browsing/core/browser/password_protection/metrics_util.h" | ||
| 2796 | #include "components/safe_browsing/core/common/proto/csd.pb.h" | ||
| 2797 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 2798 | #include "components/strings/grit/components_strings.h" | ||
| 2799 | #include "components/url_formatter/url_formatter.h" | ||
| 2800 | #include "components/user_prefs/user_prefs.h" | ||
| 2801 | --- chrome/browser/ui/webui/settings/people_handler.cc.orig | ||
| 2802 | +++ chrome/browser/ui/webui/settings/people_handler.cc | ||
| 2803 | @@ -41,7 +41,6 @@ | ||
| 2804 | #include "components/prefs/pref_service.h" | ||
| 2805 | #include "components/signin/core/browser/signin_error_controller.h" | ||
| 2806 | #include "components/signin/public/base/signin_metrics.h" | ||
| 2807 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2808 | #include "components/signin/public/identity_manager/accounts_mutator.h" | ||
| 2809 | #include "components/signin/public/identity_manager/consent_level.h" | ||
| 2810 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 2811 | @@ -290,10 +289,6 @@ void PeopleHandler::RegisterMessages() { | ||
| 2812 | void PeopleHandler::OnJavascriptAllowed() { | ||
| 2813 | PrefService* prefs = profile_->GetPrefs(); | ||
| 2814 | profile_pref_registrar_.Init(prefs); | ||
| 2815 | - profile_pref_registrar_.Add( | ||
| 2816 | - prefs::kSigninAllowed, | ||
| 2817 | - base::BindRepeating(&PeopleHandler::UpdateSyncStatus, | ||
| 2818 | - base::Unretained(this))); | ||
| 2819 | |||
| 2820 | signin::IdentityManager* identity_manager( | ||
| 2821 | IdentityManagerFactory::GetInstance()->GetForProfile(profile_)); | ||
| 2822 | --- chrome/browser/ui/webui/settings/safety_check_handler.cc.orig | ||
| 2823 | +++ chrome/browser/ui/webui/settings/safety_check_handler.cc | ||
| 2824 | @@ -28,7 +28,6 @@ | ||
| 2825 | #include "chrome/grit/chromium_strings.h" | ||
| 2826 | #include "chrome/grit/generated_resources.h" | ||
| 2827 | #include "components/prefs/pref_service.h" | ||
| 2828 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 2829 | #include "components/strings/grit/components_strings.h" | ||
| 2830 | #include "components/version_info/version_info.h" | ||
| 2831 | #include "content/public/browser/browser_context.h" | ||
| 2832 | --- chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc.orig | ||
| 2833 | +++ chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc | ||
| 2834 | @@ -67,7 +67,6 @@ | ||
| 2835 | #include "components/password_manager/core/browser/manage_passwords_referrer.h" | ||
| 2836 | #include "components/password_manager/core/common/password_manager_features.h" | ||
| 2837 | #include "components/prefs/pref_service.h" | ||
| 2838 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 2839 | #include "components/signin/public/base/signin_buildflags.h" | ||
| 2840 | #include "components/strings/grit/components_chromium_strings.h" | ||
| 2841 | #include "components/strings/grit/components_strings.h" | ||
| 2842 | @@ -1391,46 +1390,6 @@ void AddPrivacyStrings(content::WebUIDat | ||
| 2843 | {"clearBrowsingData", IDS_SETTINGS_CLEAR_BROWSING_DATA}, | ||
| 2844 | {"clearBrowsingDataDescription", IDS_SETTINGS_CLEAR_DATA_DESCRIPTION}, | ||
| 2845 | {"titleAndCount", IDS_SETTINGS_TITLE_AND_COUNT}, | ||
| 2846 | - {"safeBrowsingEnableExtendedReporting", | ||
| 2847 | - IDS_SETTINGS_SAFEBROWSING_ENABLE_REPORTING}, | ||
| 2848 | - {"safeBrowsingEnableExtendedReportingDesc", | ||
| 2849 | - IDS_SETTINGS_SAFEBROWSING_ENABLE_REPORTING_DESC}, | ||
| 2850 | - {"safeBrowsingEnhanced", IDS_SETTINGS_SAFEBROWSING_ENHANCED}, | ||
| 2851 | - {"safeBrowsingEnhancedDesc", IDS_SETTINGS_SAFEBROWSING_ENHANCED_DESC}, | ||
| 2852 | - {"safeBrowsingEnhancedExpandA11yLabel", | ||
| 2853 | - IDS_SETTINGS_SAFEBROWSING_ENHANCED_EXPAND_ACCESSIBILITY_LABEL}, | ||
| 2854 | - {"safeBrowsingEnhancedBulOne", | ||
| 2855 | - IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_ONE}, | ||
| 2856 | - {"safeBrowsingEnhancedBulTwo", | ||
| 2857 | - IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_TWO}, | ||
| 2858 | - {"safeBrowsingEnhancedBulThree", | ||
| 2859 | - IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_THREE}, | ||
| 2860 | - {"safeBrowsingEnhancedBulFour", | ||
| 2861 | - IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_FOUR}, | ||
| 2862 | - {"safeBrowsingEnhancedBulFive", | ||
| 2863 | - IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_FIVE}, | ||
| 2864 | - {"safeBrowsingStandard", IDS_SETTINGS_SAFEBROWSING_STANDARD}, | ||
| 2865 | - {"safeBrowsingStandardDesc", IDS_SETTINGS_SAFEBROWSING_STANDARD_DESC}, | ||
| 2866 | - {"safeBrowsingStandardExpandA11yLabel", | ||
| 2867 | - IDS_SETTINGS_SAFEBROWSING_STANDARD_EXPAND_ACCESSIBILITY_LABEL}, | ||
| 2868 | - {"safeBrowsingStandardBulOne", | ||
| 2869 | - IDS_SETTINGS_SAFEBROWSING_STANDARD_BULLET_ONE}, | ||
| 2870 | - {"safeBrowsingStandardBulTwo", | ||
| 2871 | - IDS_SETTINGS_SAFEBROWSING_STANDARD_BULLET_TWO}, | ||
| 2872 | - {"safeBrowsingStandardReportingLabel", | ||
| 2873 | - IDS_SETTINGS_SAFEBROWSING_STANDARD_HELP_IMPROVE}, | ||
| 2874 | - {"safeBrowsingNone", IDS_SETTINGS_SAFEBROWSING_NONE}, | ||
| 2875 | - {"safeBrowsingNoneDesc", IDS_SETTINGS_SAFEBROWSING_NONE_DESC}, | ||
| 2876 | - {"safeBrowsingDisableDialog", | ||
| 2877 | - IDS_SETTINGS_SAFEBROWSING_DISABLE_DIALOG_TITLE}, | ||
| 2878 | - {"safeBrowsingDisableDialogDesc", | ||
| 2879 | - IDS_SETTINGS_SAFEBROWSING_DISABLE_DIALOG_DESC}, | ||
| 2880 | - {"safeBrowsingDisableDialogConfirm", | ||
| 2881 | - IDS_SETTINGS_SAFEBROWSING_DISABLE_DIALOG_CONFIRM}, | ||
| 2882 | - {"safeBrowsingEnableProtection", | ||
| 2883 | - IDS_SETTINGS_SAFEBROWSING_ENABLEPROTECTION}, | ||
| 2884 | - {"safeBrowsingEnableProtectionDesc", | ||
| 2885 | - IDS_SETTINGS_SAFEBROWSING_ENABLEPROTECTION_DESC}, | ||
| 2886 | {"safeBrowsingSectionLabel", IDS_SETTINGS_SAFEBROWSING_SECTION_LABEL}, | ||
| 2887 | {"syncAndGoogleServicesPrivacyDescription", | ||
| 2888 | IDS_SETTINGS_SYNC_AND_GOOGLE_SERVICES_PRIVACY_DESC_UNIFIED_CONSENT}, | ||
| 2889 | @@ -2626,11 +2585,6 @@ void AddSiteSettingsStrings(content::Web | ||
| 2890 | html_source->AddLocalizedStrings(kSensorsLocalizedStrings); | ||
| 2891 | |||
| 2892 | html_source->AddBoolean( | ||
| 2893 | - "enableSafeBrowsingSubresourceFilter", | ||
| 2894 | - base::FeatureList::IsEnabled( | ||
| 2895 | - subresource_filter::kSafeBrowsingSubresourceFilter)); | ||
| 2896 | - | ||
| 2897 | - html_source->AddBoolean( | ||
| 2898 | "enableBlockAutoplayContentSetting", | ||
| 2899 | base::FeatureList::IsEnabled(media::kAutoplayDisableSettings)); | ||
| 2900 | |||
| 2901 | --- chrome/browser/ui/webui/settings/settings_ui.cc.orig | ||
| 2902 | +++ chrome/browser/ui/webui/settings/settings_ui.cc | ||
| 2903 | @@ -72,7 +72,6 @@ | ||
| 2904 | #include "components/pref_registry/pref_registry_syncable.h" | ||
| 2905 | #include "components/prefs/pref_service.h" | ||
| 2906 | #include "components/safe_browsing/core/common/features.h" | ||
| 2907 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2908 | #include "content/public/browser/url_data_source.h" | ||
| 2909 | #include "content/public/browser/web_contents.h" | ||
| 2910 | #include "content/public/browser/web_ui.h" | ||
| 2911 | @@ -274,9 +273,7 @@ SettingsUI::SettingsUI(content::WebUI* w | ||
| 2912 | ? "enable-branding-update" | ||
| 2913 | : ""); | ||
| 2914 | |||
| 2915 | - html_source->AddBoolean("signinAllowed", !profile->IsGuestSession() && | ||
| 2916 | - profile->GetPrefs()->GetBoolean( | ||
| 2917 | - prefs::kSigninAllowed)); | ||
| 2918 | + html_source->AddBoolean("signinAllowed", false); | ||
| 2919 | |||
| 2920 | html_source->AddBoolean("showImportPasswords", | ||
| 2921 | base::FeatureList::IsEnabled( | ||
| 2922 | --- chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.cc.orig | ||
| 2923 | +++ chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.cc | ||
| 2924 | @@ -46,7 +46,6 @@ | ||
| 2925 | #include "components/policy/core/common/management/management_service.h" | ||
| 2926 | #include "components/prefs/pref_service.h" | ||
| 2927 | #include "components/signin/public/base/signin_metrics.h" | ||
| 2928 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2929 | #include "components/signin/public/identity_manager/accounts_mutator.h" | ||
| 2930 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 2931 | #include "components/signin/public/identity_manager/primary_account_mutator.h" | ||
| 2932 | @@ -248,8 +247,7 @@ DiceTurnSyncOnHelper::DiceTurnSyncOnHelp | ||
| 2933 | // last authenticated account of the current profile, then Chrome will show a | ||
| 2934 | // confirmation dialog before starting sync. | ||
| 2935 | // TODO(skym): Warn for high risk upgrade scenario (https://crbug.com/572754). | ||
| 2936 | - std::string last_email = | ||
| 2937 | - profile_->GetPrefs()->GetString(prefs::kGoogleServicesLastUsername); | ||
| 2938 | + std::string last_email; | ||
| 2939 | delegate_->ShowMergeSyncDataConfirmation( | ||
| 2940 | last_email, account_info_.email, | ||
| 2941 | base::BindOnce(&DiceTurnSyncOnHelper::OnMergeAccountConfirmation, | ||
| 2942 | --- chrome/browser/ui/webui/signin/dice_turn_sync_on_helper_unittest.cc.orig | ||
| 2943 | +++ chrome/browser/ui/webui/signin/dice_turn_sync_on_helper_unittest.cc | ||
| 2944 | @@ -38,7 +38,6 @@ | ||
| 2945 | #include "components/prefs/pref_service.h" | ||
| 2946 | #include "components/signin/public/base/account_consistency_method.h" | ||
| 2947 | #include "components/signin/public/base/signin_metrics.h" | ||
| 2948 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2949 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 2950 | #include "components/signin/public/identity_manager/identity_test_environment.h" | ||
| 2951 | #include "components/signin/public/identity_manager/primary_account_mutator.h" | ||
| 2952 | --- chrome/browser/ui/webui/signin/inline_login_handler.cc.orig | ||
| 2953 | +++ chrome/browser/ui/webui/signin/inline_login_handler.cc | ||
| 2954 | @@ -27,7 +27,6 @@ | ||
| 2955 | #include "chrome/common/pref_names.h" | ||
| 2956 | #include "components/metrics/metrics_pref_names.h" | ||
| 2957 | #include "components/prefs/pref_service.h" | ||
| 2958 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2959 | #include "content/public/browser/storage_partition.h" | ||
| 2960 | #include "content/public/browser/web_contents.h" | ||
| 2961 | #include "content/public/browser/web_ui.h" | ||
| 2962 | @@ -127,8 +126,6 @@ void InlineLoginHandler::ContinueHandleI | ||
| 2963 | std::string default_email; | ||
| 2964 | if (reason == signin_metrics::Reason::kSigninPrimaryAccount || | ||
| 2965 | reason == signin_metrics::Reason::kForcedSigninPrimaryAccount) { | ||
| 2966 | - default_email = | ||
| 2967 | - profile->GetPrefs()->GetString(prefs::kGoogleServicesLastUsername); | ||
| 2968 | } else { | ||
| 2969 | if (!net::GetValueForKeyInQuery(current_url, "email", &default_email)) | ||
| 2970 | default_email.clear(); | ||
| 2971 | --- chrome/browser/ui/webui/signin/inline_login_handler_impl.cc.orig | ||
| 2972 | +++ chrome/browser/ui/webui/signin/inline_login_handler_impl.cc | ||
| 2973 | @@ -70,7 +70,6 @@ | ||
| 2974 | #include "components/prefs/pref_service.h" | ||
| 2975 | #include "components/signin/core/browser/about_signin_internals.h" | ||
| 2976 | #include "components/signin/public/base/signin_metrics.h" | ||
| 2977 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2978 | #include "components/signin/public/identity_manager/account_info.h" | ||
| 2979 | #include "components/signin/public/identity_manager/accounts_cookie_mutator.h" | ||
| 2980 | #include "components/signin/public/identity_manager/accounts_mutator.h" | ||
| 2981 | --- chrome/browser/ui/webui/signin/signin_error_ui.cc.orig | ||
| 2982 | +++ chrome/browser/ui/webui/signin/signin_error_ui.cc | ||
| 2983 | @@ -23,7 +23,6 @@ | ||
| 2984 | #include "chrome/grit/generated_resources.h" | ||
| 2985 | #include "chrome/grit/signin_resources.h" | ||
| 2986 | #include "components/prefs/pref_service.h" | ||
| 2987 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 2988 | #include "components/strings/grit/components_strings.h" | ||
| 2989 | #include "content/public/browser/web_ui.h" | ||
| 2990 | #include "content/public/browser/web_ui_data_source.h" | ||
| 2991 | @@ -115,9 +114,7 @@ void SigninErrorUI::Initialize(Browser* | ||
| 2992 | if (is_profile_blocked) { | ||
| 2993 | source->AddLocalizedString("profileBlockedMessage", | ||
| 2994 | IDS_OLD_PROFILES_DISABLED_MESSAGE); | ||
| 2995 | - std::string allowed_domain = signin_ui_util::GetAllowedDomain( | ||
| 2996 | - g_browser_process->local_state()->GetString( | ||
| 2997 | - prefs::kGoogleServicesUsernamePattern)); | ||
| 2998 | + std::string allowed_domain; | ||
| 2999 | if (allowed_domain.empty()) { | ||
| 3000 | source->AddLocalizedString( | ||
| 3001 | "profileBlockedAddPersonSuggestion", | ||
| 3002 | --- chrome/browser/ui/webui/signin/signin_utils_desktop.cc.orig | ||
| 3003 | +++ chrome/browser/ui/webui/signin/signin_utils_desktop.cc | ||
| 3004 | @@ -18,7 +18,6 @@ | ||
| 3005 | #include "chrome/grit/chromium_strings.h" | ||
| 3006 | #include "chrome/grit/generated_resources.h" | ||
| 3007 | #include "components/guest_view/browser/guest_view_manager.h" | ||
| 3008 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 3009 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 3010 | #include "components/signin/public/identity_manager/identity_utils.h" | ||
| 3011 | #include "google_apis/gaia/gaia_auth_util.h" | ||
| 3012 | @@ -30,7 +29,7 @@ SigninUIError CanOfferSignin(Profile* pr | ||
| 3013 | if (!profile) | ||
| 3014 | return SigninUIError::Other(email); | ||
| 3015 | |||
| 3016 | - if (!profile->GetPrefs()->GetBoolean(prefs::kSigninAllowed)) | ||
| 3017 | + if (true) | ||
| 3018 | return SigninUIError::Other(email); | ||
| 3019 | |||
| 3020 | if (!ChromeSigninClient::ProfileAllowsSigninCookies(profile)) | ||
| 3021 | @@ -103,8 +102,7 @@ SigninUIError CanOfferSignin(Profile* pr | ||
| 3022 | // With force sign in enabled, cross account sign in is not allowed. | ||
| 3023 | if (signin_util::IsForceSigninEnabled() && | ||
| 3024 | IsCrossAccountError(profile, email, gaia_id)) { | ||
| 3025 | - std::string last_email = | ||
| 3026 | - profile->GetPrefs()->GetString(prefs::kGoogleServicesLastUsername); | ||
| 3027 | + std::string last_email; | ||
| 3028 | return SigninUIError::ProfileWasUsedByAnotherAccount(email, last_email); | ||
| 3029 | } | ||
| 3030 | } | ||
| 3031 | --- chrome/browser/ui/webui/welcome/welcome_ui.cc.orig | ||
| 3032 | +++ chrome/browser/ui/webui/welcome/welcome_ui.cc | ||
| 3033 | @@ -24,7 +24,6 @@ | ||
| 3034 | #include "chrome/grit/welcome_resources.h" | ||
| 3035 | #include "chrome/grit/welcome_resources_map.h" | ||
| 3036 | #include "components/prefs/pref_service.h" | ||
| 3037 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 3038 | #include "components/strings/grit/components_strings.h" | ||
| 3039 | #include "net/base/url_util.h" | ||
| 3040 | #include "ui/base/webui/web_ui_util.h" | ||
| 3041 | @@ -166,7 +165,7 @@ WelcomeUI::WelcomeUI(content::WebUI* web | ||
| 3042 | "returningUserModules", | ||
| 3043 | welcome::GetModules(profile).FindKey("returning-user")->GetString()); | ||
| 3044 | html_source->AddBoolean( | ||
| 3045 | - "signinAllowed", profile->GetPrefs()->GetBoolean(prefs::kSigninAllowed)); | ||
| 3046 | + "signinAllowed", false); | ||
| 3047 | html_source->SetRequestFilter( | ||
| 3048 | base::BindRepeating(&ShouldHandleRequestCallback, | ||
| 3049 | weak_ptr_factory_.GetWeakPtr()), | ||
| 3050 | --- chrome/browser/unified_consent/unified_consent_service_factory.cc.orig | ||
| 3051 | +++ chrome/browser/unified_consent/unified_consent_service_factory.cc | ||
| 3052 | @@ -13,7 +13,6 @@ | ||
| 3053 | #include "components/embedder_support/pref_names.h" | ||
| 3054 | #include "components/keyed_service/content/browser_context_dependency_manager.h" | ||
| 3055 | #include "components/prefs/pref_registry_simple.h" | ||
| 3056 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3057 | #include "components/spellcheck/browser/pref_names.h" | ||
| 3058 | #include "components/sync_preferences/pref_service_syncable.h" | ||
| 3059 | #include "components/unified_consent/unified_consent_metrics.h" | ||
| 3060 | @@ -35,7 +34,6 @@ namespace { | ||
| 3061 | std::vector<std::string> GetSyncedServicePrefNames() { | ||
| 3062 | return { | ||
| 3063 | prefs::kSearchSuggestEnabled, embedder_support::kAlternateErrorPagesEnabled, | ||
| 3064 | - prefs::kSafeBrowsingEnabled, prefs::kSafeBrowsingScoutReportingEnabled, | ||
| 3065 | spellcheck::prefs::kSpellCheckUseSpellingService, | ||
| 3066 | #if defined(OS_ANDROID) | ||
| 3067 | prefs::kContextualSearchEnabled | ||
| 3068 | --- chrome/common/extensions/api/privacy.json.orig | ||
| 3069 | +++ chrome/common/extensions/api/privacy.json | ||
| 3070 | @@ -63,16 +63,6 @@ | ||
| 3071 | "value": ["passwordSavingEnabled", {"type":"boolean"}], | ||
| 3072 | "description": "If enabled, the password manager will ask if you want to save passwords. This preference's value is a boolean, defaulting to <code>true</code>." | ||
| 3073 | }, | ||
| 3074 | - "safeBrowsingEnabled": { | ||
| 3075 | - "$ref": "types.ChromeSetting", | ||
| 3076 | - "value": ["safeBrowsingEnabled", {"type":"boolean"}], | ||
| 3077 | - "description": "If enabled, Chrome does its best to protect you from phishing and malware. This preference's value is a boolean, defaulting to <code>true</code>." | ||
| 3078 | - }, | ||
| 3079 | - "safeBrowsingExtendedReportingEnabled": { | ||
| 3080 | - "$ref": "types.ChromeSetting", | ||
| 3081 | - "value": ["safeBrowsingExtendedReportingEnabled", {"type":"boolean"}], | ||
| 3082 | - "description": "If enabled, Chrome will send additional information to Google when SafeBrowsing blocks a page, such as the content of the blocked page. This preference's value is a boolean, defaulting to <code>false</code>." | ||
| 3083 | - }, | ||
| 3084 | "searchSuggestEnabled": { | ||
| 3085 | "$ref": "types.ChromeSetting", | ||
| 3086 | "value": ["searchSuggestEnabled", {"type":"boolean"}], | ||
| 3087 | --- components/password_manager/core/browser/leak_detection_delegate.cc.orig | ||
| 3088 | +++ components/password_manager/core/browser/leak_detection_delegate.cc | ||
| 3089 | @@ -22,7 +22,6 @@ | ||
| 3090 | #include "components/password_manager/core/common/password_manager_features.h" | ||
| 3091 | #include "components/password_manager/core/common/password_manager_pref_names.h" | ||
| 3092 | #include "components/prefs/pref_service.h" | ||
| 3093 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3094 | #include "services/network/public/cpp/shared_url_loader_factory.h" | ||
| 3095 | |||
| 3096 | namespace password_manager { | ||
| 3097 | @@ -169,28 +168,7 @@ void LeakDetectionDelegate::OnError(Leak | ||
| 3098 | |||
| 3099 | bool CanStartLeakCheck(const PrefService& prefs, | ||
| 3100 | const PasswordManagerClient* client) { | ||
| 3101 | - const bool is_leak_protection_on = | ||
| 3102 | - prefs.GetBoolean(password_manager::prefs::kPasswordLeakDetectionEnabled); | ||
| 3103 | - | ||
| 3104 | - // Leak detection can only start if: | ||
| 3105 | - // 1. The user has not opted out and Safe Browsing is turned on, or | ||
| 3106 | - // 2. The user is an enhanced protection user | ||
| 3107 | - safe_browsing::SafeBrowsingState sb_state = | ||
| 3108 | - safe_browsing::GetSafeBrowsingState(prefs); | ||
| 3109 | - switch (sb_state) { | ||
| 3110 | - case safe_browsing::SafeBrowsingState::NO_SAFE_BROWSING: | ||
| 3111 | - LogString(client, Logger::STRING_LEAK_DETECTION_DISABLED_SAFE_BROWSING); | ||
| 3112 | - return false; | ||
| 3113 | - case safe_browsing::SafeBrowsingState::STANDARD_PROTECTION: | ||
| 3114 | - if (!is_leak_protection_on) | ||
| 3115 | - LogString(client, Logger::STRING_LEAK_DETECTION_DISABLED_FEATURE); | ||
| 3116 | - return is_leak_protection_on; | ||
| 3117 | - case safe_browsing::SafeBrowsingState::ENHANCED_PROTECTION: | ||
| 3118 | - // feature is on. | ||
| 3119 | - break; | ||
| 3120 | - } | ||
| 3121 | - | ||
| 3122 | - return true; | ||
| 3123 | + return false; | ||
| 3124 | } | ||
| 3125 | |||
| 3126 | } // namespace password_manager | ||
| 3127 | --- components/password_manager/core/browser/password_bubble_experiment.cc.orig | ||
| 3128 | +++ components/password_manager/core/browser/password_bubble_experiment.cc | ||
| 3129 | @@ -18,7 +18,6 @@ | ||
| 3130 | #include "components/prefs/pref_registry_simple.h" | ||
| 3131 | #include "components/prefs/pref_service.h" | ||
| 3132 | #include "components/signin/public/base/signin_buildflags.h" | ||
| 3133 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 3134 | #include "components/sync/driver/sync_service.h" | ||
| 3135 | #include "components/sync/driver/sync_user_settings.h" | ||
| 3136 | |||
| 3137 | --- components/password_manager/core/browser/password_reuse_detector.cc.orig | ||
| 3138 | +++ components/password_manager/core/browser/password_reuse_detector.cc | ||
| 3139 | @@ -15,7 +15,6 @@ | ||
| 3140 | #include "components/password_manager/core/browser/password_reuse_detector_consumer.h" | ||
| 3141 | #include "components/password_manager/core/browser/password_store_consumer.h" | ||
| 3142 | #include "components/password_manager/core/browser/psl_matching_helper.h" | ||
| 3143 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3144 | #include "google_apis/gaia/gaia_auth_util.h" | ||
| 3145 | #include "google_apis/gaia/gaia_urls.h" | ||
| 3146 | #include "url/origin.h" | ||
| 3147 | @@ -205,9 +204,7 @@ PasswordReuseDetector::CheckNonGaiaEnter | ||
| 3148 | // Skips password reuse check if |domain| matches enterprise login URL or | ||
| 3149 | // enterprise change password URL. | ||
| 3150 | GURL page_url(domain); | ||
| 3151 | - if (enterprise_password_urls_.has_value() && | ||
| 3152 | - safe_browsing::MatchesURLList(page_url, | ||
| 3153 | - enterprise_password_urls_.value())) { | ||
| 3154 | + if (enterprise_password_urls_.has_value()) { | ||
| 3155 | return absl::nullopt; | ||
| 3156 | } | ||
| 3157 | |||
| 3158 | --- components/password_manager/core/browser/password_reuse_manager_impl.cc.orig | ||
| 3159 | +++ components/password_manager/core/browser/password_reuse_manager_impl.cc | ||
| 3160 | @@ -9,7 +9,6 @@ | ||
| 3161 | #include "components/password_manager/core/browser/password_store_signin_notifier.h" | ||
| 3162 | #include "components/password_manager/core/common/password_manager_features.h" | ||
| 3163 | #include "components/prefs/pref_service.h" | ||
| 3164 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3165 | |||
| 3166 | namespace password_manager { | ||
| 3167 | |||
| 3168 | @@ -318,20 +317,6 @@ void PasswordReuseManagerImpl::ScheduleP | ||
| 3169 | |||
| 3170 | void PasswordReuseManagerImpl::ScheduleEnterprisePasswordURLUpdate() { | ||
| 3171 | DCHECK(main_task_runner_->RunsTasksInCurrentSequence()); | ||
| 3172 | - | ||
| 3173 | - if (!prefs_) | ||
| 3174 | - return; | ||
| 3175 | - std::vector<GURL> enterprise_login_urls; | ||
| 3176 | - safe_browsing::GetPasswordProtectionLoginURLsPref(*prefs_, | ||
| 3177 | - &enterprise_login_urls); | ||
| 3178 | - GURL enterprise_change_password_url = | ||
| 3179 | - safe_browsing::GetPasswordProtectionChangePasswordURLPref(*prefs_); | ||
| 3180 | - if (!reuse_detector_) | ||
| 3181 | - return; | ||
| 3182 | - ScheduleTask(base::BindOnce(&PasswordReuseDetector::UseEnterprisePasswordURLs, | ||
| 3183 | - base::Unretained(reuse_detector_), | ||
| 3184 | - std::move(enterprise_login_urls), | ||
| 3185 | - std::move(enterprise_change_password_url))); | ||
| 3186 | } | ||
| 3187 | |||
| 3188 | void PasswordReuseManagerImpl::OnGetPasswordStoreResults( | ||
| 3189 | --- components/password_manager/core/browser/password_store.cc.orig | ||
| 3190 | +++ components/password_manager/core/browser/password_store.cc | ||
| 3191 | @@ -39,7 +39,6 @@ | ||
| 3192 | #include "components/password_manager/core/common/password_manager_features.h" | ||
| 3193 | #include "components/password_manager/core/common/password_manager_pref_names.h" | ||
| 3194 | #include "components/prefs/pref_service.h" | ||
| 3195 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3196 | #include "components/sync/model/proxy_model_type_controller_delegate.h" | ||
| 3197 | |||
| 3198 | namespace password_manager { | ||
| 3199 | --- components/password_manager/core/browser/password_sync_util.cc.orig | ||
| 3200 | +++ components/password_manager/core/browser/password_sync_util.cc | ||
| 3201 | @@ -8,7 +8,6 @@ | ||
| 3202 | #include "build/build_config.h" | ||
| 3203 | #include "components/password_manager/core/browser/password_form.h" | ||
| 3204 | #include "components/password_manager/core/common/password_manager_features.h" | ||
| 3205 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3206 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 3207 | #include "components/sync/base/user_selectable_type.h" | ||
| 3208 | #include "components/sync/driver/sync_user_settings.h" | ||
| 3209 | @@ -88,11 +87,6 @@ bool IsGaiaCredentialPage(const std::str | ||
| 3210 | |||
| 3211 | bool ShouldSaveEnterprisePasswordHash(const PasswordForm& form, | ||
| 3212 | const PrefService& prefs) { | ||
| 3213 | - if (base::FeatureList::IsEnabled(features::kPasswordReuseDetectionEnabled)) { | ||
| 3214 | - return safe_browsing::MatchesPasswordProtectionLoginURL(form.url, prefs) || | ||
| 3215 | - safe_browsing::MatchesPasswordProtectionChangePasswordURL(form.url, | ||
| 3216 | - prefs); | ||
| 3217 | - } | ||
| 3218 | return false; | ||
| 3219 | } | ||
| 3220 | |||
| 3221 | --- components/password_manager/core/browser/sync_credentials_filter_unittest.cc.orig | ||
| 3222 | +++ components/password_manager/core/browser/sync_credentials_filter_unittest.cc | ||
| 3223 | @@ -29,7 +29,6 @@ | ||
| 3224 | #include "components/password_manager/core/common/password_manager_features.h" | ||
| 3225 | #include "components/prefs/pref_registry_simple.h" | ||
| 3226 | #include "components/prefs/testing_pref_service.h" | ||
| 3227 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3228 | #include "testing/gtest/include/gtest/gtest.h" | ||
| 3229 | |||
| 3230 | namespace password_manager { | ||
| 3231 | --- components/safe_browsing/content/browser/base_blocking_page.cc.orig | ||
| 3232 | +++ components/safe_browsing/content/browser/base_blocking_page.cc | ||
| 3233 | @@ -13,7 +13,6 @@ | ||
| 3234 | #include "base/time/time.h" | ||
| 3235 | #include "components/safe_browsing/content/browser/safe_browsing_controller_client.h" | ||
| 3236 | #include "components/safe_browsing/core/common/features.h" | ||
| 3237 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3238 | #include "components/security_interstitials/content/security_interstitial_controller_client.h" | ||
| 3239 | #include "components/security_interstitials/content/settings_page_helper.h" | ||
| 3240 | #include "components/security_interstitials/content/unsafe_resource_util.h" | ||
| 3241 | --- components/safe_browsing/content/browser/client_side_detection_service.cc.orig | ||
| 3242 | +++ components/safe_browsing/content/browser/client_side_detection_service.cc | ||
| 3243 | @@ -28,7 +28,6 @@ | ||
| 3244 | #include "components/safe_browsing/core/common/features.h" | ||
| 3245 | #include "components/safe_browsing/core/common/proto/client_model.pb.h" | ||
| 3246 | #include "components/safe_browsing/core/common/proto/csd.pb.h" | ||
| 3247 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3248 | #include "components/safe_browsing/core/common/safebrowsing_constants.h" | ||
| 3249 | #include "components/safe_browsing/core/common/utils.h" | ||
| 3250 | #include "content/public/browser/browser_task_traits.h" | ||
| 3251 | --- components/safe_browsing/content/browser/safe_browsing_navigation_observer_manager.cc.orig | ||
| 3252 | +++ components/safe_browsing/content/browser/safe_browsing_navigation_observer_manager.cc | ||
| 3253 | @@ -20,7 +20,6 @@ | ||
| 3254 | #include "components/safe_browsing/content/browser/safe_browsing_navigation_observer_manager_util.h" | ||
| 3255 | #include "components/safe_browsing/content/browser/web_ui/safe_browsing_ui.h" | ||
| 3256 | #include "components/safe_browsing/core/common/features.h" | ||
| 3257 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3258 | #include "components/safe_browsing/core/common/utils.h" | ||
| 3259 | #include "components/sessions/content/session_tab_helper.h" | ||
| 3260 | #include "content/public/browser/navigation_details.h" | ||
| 3261 | @@ -306,7 +305,7 @@ GURL SafeBrowsingNavigationObserverManag | ||
| 3262 | bool SafeBrowsingNavigationObserverManager::IsEnabledAndReady( | ||
| 3263 | PrefService* prefs, | ||
| 3264 | bool has_safe_browsing_service) { | ||
| 3265 | - return IsSafeBrowsingEnabled(*prefs) && has_safe_browsing_service; | ||
| 3266 | + return false; | ||
| 3267 | } | ||
| 3268 | |||
| 3269 | // static | ||
| 3270 | --- components/safe_browsing/content/browser/triggers/suspicious_site_trigger_unittest.cc.orig | ||
| 3271 | +++ components/safe_browsing/content/browser/triggers/suspicious_site_trigger_unittest.cc | ||
| 3272 | @@ -11,7 +11,6 @@ | ||
| 3273 | #include "build/build_config.h" | ||
| 3274 | #include "components/prefs/testing_pref_service.h" | ||
| 3275 | #include "components/safe_browsing/content/browser/triggers/mock_trigger_manager.h" | ||
| 3276 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3277 | #include "content/public/test/browser_task_environment.h" | ||
| 3278 | #include "content/public/test/navigation_simulator.h" | ||
| 3279 | #include "content/public/test/test_renderer_host.h" | ||
| 3280 | --- components/safe_browsing/content/browser/triggers/trigger_manager.cc.orig | ||
| 3281 | +++ components/safe_browsing/content/browser/triggers/trigger_manager.cc | ||
| 3282 | @@ -12,7 +12,6 @@ | ||
| 3283 | #include "components/safe_browsing/content/browser/base_ui_manager.h" | ||
| 3284 | #include "components/safe_browsing/content/browser/threat_details.h" | ||
| 3285 | #include "components/safe_browsing/core/common/features.h" | ||
| 3286 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3287 | #include "components/security_interstitials/core/unsafe_resource.h" | ||
| 3288 | #include "content/public/browser/browser_context.h" | ||
| 3289 | #include "content/public/browser/browser_thread.h" | ||
| 3290 | @@ -85,16 +84,16 @@ SBErrorOptions TriggerManager::GetSBErro | ||
| 3291 | const PrefService& pref_service, | ||
| 3292 | content::WebContents* web_contents) { | ||
| 3293 | return SBErrorOptions(/*is_main_frame_load_blocked=*/false, | ||
| 3294 | - IsExtendedReportingOptInAllowed(pref_service), | ||
| 3295 | + /*IsExtendedReportingOptInAllowed(pref_service)*/false, | ||
| 3296 | web_contents->GetBrowserContext()->IsOffTheRecord(), | ||
| 3297 | - IsExtendedReportingEnabled(pref_service), | ||
| 3298 | - IsExtendedReportingPolicyManaged(pref_service), | ||
| 3299 | - IsEnhancedProtectionEnabled(pref_service), | ||
| 3300 | + /*IsExtendedReportingEnabled(pref_service)*/false, | ||
| 3301 | + /*IsExtendedReportingPolicyManaged(pref_service)*/false, | ||
| 3302 | + /*IsEnhancedProtectionEnabled(pref_service)*/false, | ||
| 3303 | /*is_proceed_anyway_disabled=*/false, | ||
| 3304 | /*should_open_links_in_new_tab=*/false, | ||
| 3305 | /*always_show_back_to_safety=*/true, | ||
| 3306 | - /*is_enhanced_protection_message_enabled=*/true, | ||
| 3307 | - IsSafeBrowsingPolicyManaged(pref_service), | ||
| 3308 | + /*is_enhanced_protection_message_enabled=*/false, | ||
| 3309 | + /*IsSafeBrowsingPolicyManaged(pref_service)*/false, | ||
| 3310 | /*help_center_article_link=*/std::string()); | ||
| 3311 | } | ||
| 3312 | |||
| 3313 | --- components/safe_browsing/content/browser/triggers/trigger_throttler.cc.orig | ||
| 3314 | +++ components/safe_browsing/content/browser/triggers/trigger_throttler.cc | ||
| 3315 | @@ -197,28 +197,6 @@ void TriggerThrottler::LoadTriggerEvents | ||
| 3316 | trigger_events_.clear(); | ||
| 3317 | if (!local_state_prefs_) | ||
| 3318 | return; | ||
| 3319 | - | ||
| 3320 | - const base::DictionaryValue* event_dict = local_state_prefs_->GetDictionary( | ||
| 3321 | - prefs::kSafeBrowsingTriggerEventTimestamps); | ||
| 3322 | - for (auto trigger_pair : event_dict->DictItems()) { | ||
| 3323 | - // Check that the first item in the pair is convertible to a trigger type | ||
| 3324 | - // and that the second item is a list. | ||
| 3325 | - int trigger_type_int; | ||
| 3326 | - if (!base::StringToInt(trigger_pair.first, &trigger_type_int) || | ||
| 3327 | - trigger_type_int < static_cast<int>(TriggerType::kMinTriggerType) || | ||
| 3328 | - trigger_type_int > static_cast<int>(TriggerType::kMaxTriggerType)) { | ||
| 3329 | - continue; | ||
| 3330 | - } | ||
| 3331 | - if (!trigger_pair.second.is_list()) | ||
| 3332 | - continue; | ||
| 3333 | - | ||
| 3334 | - const TriggerType trigger_type = static_cast<TriggerType>(trigger_type_int); | ||
| 3335 | - for (const auto& timestamp : trigger_pair.second.GetList()) { | ||
| 3336 | - if (timestamp.is_double()) | ||
| 3337 | - trigger_events_[trigger_type].push_back( | ||
| 3338 | - base::Time::FromDoubleT(timestamp.GetDouble())); | ||
| 3339 | - } | ||
| 3340 | - } | ||
| 3341 | } | ||
| 3342 | |||
| 3343 | void TriggerThrottler::WriteTriggerEventsToPref() { | ||
| 3344 | @@ -234,9 +212,6 @@ void TriggerThrottler::WriteTriggerEvent | ||
| 3345 | pref_timestamps->Append(base::Value(timestamp.ToDoubleT())); | ||
| 3346 | } | ||
| 3347 | } | ||
| 3348 | - | ||
| 3349 | - local_state_prefs_->Set(prefs::kSafeBrowsingTriggerEventTimestamps, | ||
| 3350 | - trigger_dict); | ||
| 3351 | } | ||
| 3352 | |||
| 3353 | size_t TriggerThrottler::GetDailyQuotaForTrigger( | ||
| 3354 | --- components/safe_browsing/content/browser/triggers/trigger_throttler_unittest.cc.orig | ||
| 3355 | +++ components/safe_browsing/content/browser/triggers/trigger_throttler_unittest.cc | ||
| 3356 | @@ -9,7 +9,6 @@ | ||
| 3357 | #include "base/test/simple_test_clock.h" | ||
| 3358 | #include "components/prefs/testing_pref_service.h" | ||
| 3359 | #include "components/safe_browsing/core/common/features.h" | ||
| 3360 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3361 | #include "testing/gmock/include/gmock/gmock.h" | ||
| 3362 | #include "testing/gtest/include/gtest/gtest.h" | ||
| 3363 | |||
| 3364 | --- components/safe_browsing/content/browser/ui_manager.cc.orig | ||
| 3365 | +++ components/safe_browsing/content/browser/ui_manager.cc | ||
| 3366 | @@ -18,7 +18,6 @@ | ||
| 3367 | #include "components/safe_browsing/core/browser/db/v4_protocol_manager_util.h" | ||
| 3368 | #include "components/safe_browsing/core/browser/ping_manager.h" | ||
| 3369 | #include "components/safe_browsing/core/common/features.h" | ||
| 3370 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3371 | #include "components/security_interstitials/content/security_interstitial_tab_helper.h" | ||
| 3372 | #include "components/security_interstitials/content/unsafe_resource_util.h" | ||
| 3373 | #include "components/security_interstitials/core/unsafe_resource.h" | ||
| 3374 | --- components/safe_browsing/content/browser/ui_manager_unittest.cc.orig | ||
| 3375 | +++ components/safe_browsing/content/browser/ui_manager_unittest.cc | ||
| 3376 | @@ -14,7 +14,6 @@ | ||
| 3377 | #include "components/safe_browsing/content/browser/safe_browsing_controller_client.h" | ||
| 3378 | #include "components/safe_browsing/content/browser/ui_manager.h" | ||
| 3379 | #include "components/safe_browsing/core/browser/db/util.h" | ||
| 3380 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3381 | #include "components/security_interstitials/content/security_interstitial_controller_client.h" | ||
| 3382 | #include "components/security_interstitials/content/settings_page_helper.h" | ||
| 3383 | #include "components/security_interstitials/content/unsafe_resource_util.h" | ||
| 3384 | --- components/safe_browsing/content/browser/web_ui/safe_browsing_ui.cc.orig | ||
| 3385 | +++ components/safe_browsing/content/browser/web_ui/safe_browsing_ui.cc | ||
| 3386 | @@ -32,7 +32,6 @@ | ||
| 3387 | #include "components/safe_browsing/core/browser/referrer_chain_provider.h" | ||
| 3388 | #include "components/safe_browsing/core/common/features.h" | ||
| 3389 | #include "components/safe_browsing/core/common/proto/csd.pb.h" | ||
| 3390 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3391 | #include "services/network/public/mojom/cookie_manager.mojom.h" | ||
| 3392 | #if BUILDFLAG(FULL_SAFE_BROWSING) | ||
| 3393 | #include "components/enterprise/common/proto/connectors.pb.h" | ||
| 3394 | @@ -2035,18 +2034,13 @@ void SafeBrowsingUIHandler::GetPrefs(con | ||
| 3395 | AllowJavascript(); | ||
| 3396 | DCHECK(!args->GetList().empty()); | ||
| 3397 | std::string callback_id = args->GetList()[0].GetString(); | ||
| 3398 | - ResolveJavascriptCallback(base::Value(callback_id), | ||
| 3399 | - safe_browsing::GetSafeBrowsingPreferencesList( | ||
| 3400 | - user_prefs::UserPrefs::Get(browser_context_))); | ||
| 3401 | + ResolveJavascriptCallback(base::Value(callback_id), base::ListValue()); | ||
| 3402 | } | ||
| 3403 | |||
| 3404 | void SafeBrowsingUIHandler::GetPolicies(const base::ListValue* args) { | ||
| 3405 | AllowJavascript(); | ||
| 3406 | DCHECK(!args->GetList().empty()); | ||
| 3407 | std::string callback_id = args->GetList()[0].GetString(); | ||
| 3408 | - ResolveJavascriptCallback(base::Value(callback_id), | ||
| 3409 | - safe_browsing::GetSafeBrowsingPoliciesList( | ||
| 3410 | - user_prefs::UserPrefs::Get(browser_context_))); | ||
| 3411 | } | ||
| 3412 | |||
| 3413 | void SafeBrowsingUIHandler::GetCookie(const base::ListValue* args) { | ||
| 3414 | --- components/safe_browsing/core/browser/db/hit_report.h.orig | ||
| 3415 | +++ components/safe_browsing/core/browser/db/hit_report.h | ||
| 3416 | @@ -8,7 +8,6 @@ | ||
| 3417 | #define COMPONENTS_SAFE_BROWSING_CORE_BROWSER_DB_HIT_REPORT_H_ | ||
| 3418 | |||
| 3419 | #include "components/safe_browsing/core/browser/db/util.h" | ||
| 3420 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3421 | #include "url/gurl.h" | ||
| 3422 | |||
| 3423 | namespace safe_browsing { | ||
| 3424 | @@ -42,7 +41,6 @@ struct HitReport { | ||
| 3425 | // NOTE(vakh): Unused at the moment, but may be used later. | ||
| 3426 | std::string population_id; | ||
| 3427 | |||
| 3428 | - ExtendedReportingLevel extended_reporting_level; | ||
| 3429 | bool is_enhanced_protection = false; | ||
| 3430 | bool is_metrics_reporting_active; | ||
| 3431 | |||
| 3432 | --- components/safe_browsing/core/browser/db/util.h.orig | ||
| 3433 | +++ components/safe_browsing/core/browser/db/util.h | ||
| 3434 | @@ -18,7 +18,6 @@ | ||
| 3435 | #include "base/strings/string_piece.h" | ||
| 3436 | #include "base/trace_event/traced_value.h" | ||
| 3437 | #include "components/safe_browsing/core/browser/db/v4_protocol_manager_util.h" | ||
| 3438 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3439 | |||
| 3440 | namespace safe_browsing { | ||
| 3441 | |||
| 3442 | --- components/safe_browsing/core/browser/db/v4_local_database_manager.cc.orig | ||
| 3443 | +++ components/safe_browsing/core/browser/db/v4_local_database_manager.cc | ||
| 3444 | @@ -337,10 +337,9 @@ const V4LocalDatabaseManager* | ||
| 3445 | scoped_refptr<V4LocalDatabaseManager> V4LocalDatabaseManager::Create( | ||
| 3446 | const base::FilePath& base_path, | ||
| 3447 | scoped_refptr<base::SequencedTaskRunner> ui_task_runner, | ||
| 3448 | - scoped_refptr<base::SequencedTaskRunner> io_task_runner, | ||
| 3449 | - ExtendedReportingLevelCallback extended_reporting_level_callback) { | ||
| 3450 | + scoped_refptr<base::SequencedTaskRunner> io_task_runner) { | ||
| 3451 | return base::WrapRefCounted(new V4LocalDatabaseManager( | ||
| 3452 | - base_path, extended_reporting_level_callback, std::move(ui_task_runner), | ||
| 3453 | + base_path, std::move(ui_task_runner), | ||
| 3454 | std::move(io_task_runner), nullptr)); | ||
| 3455 | } | ||
| 3456 | |||
| 3457 | @@ -363,14 +362,12 @@ void V4LocalDatabaseManager::CollectData | ||
| 3458 | |||
| 3459 | V4LocalDatabaseManager::V4LocalDatabaseManager( | ||
| 3460 | const base::FilePath& base_path, | ||
| 3461 | - ExtendedReportingLevelCallback extended_reporting_level_callback, | ||
| 3462 | scoped_refptr<base::SequencedTaskRunner> ui_task_runner, | ||
| 3463 | scoped_refptr<base::SequencedTaskRunner> io_task_runner, | ||
| 3464 | scoped_refptr<base::SequencedTaskRunner> task_runner_for_tests) | ||
| 3465 | : SafeBrowsingDatabaseManager(std::move(ui_task_runner), | ||
| 3466 | std::move(io_task_runner)), | ||
| 3467 | base_path_(base_path), | ||
| 3468 | - extended_reporting_level_callback_(extended_reporting_level_callback), | ||
| 3469 | list_infos_(GetListInfos()), | ||
| 3470 | task_runner_(task_runner_for_tests | ||
| 3471 | ? task_runner_for_tests | ||
| 3472 | @@ -1137,8 +1134,7 @@ void V4LocalDatabaseManager::SetupUpdate | ||
| 3473 | weak_factory_.GetWeakPtr()); | ||
| 3474 | |||
| 3475 | v4_update_protocol_manager_ = V4UpdateProtocolManager::Create( | ||
| 3476 | - url_loader_factory, config, update_callback, | ||
| 3477 | - extended_reporting_level_callback_); | ||
| 3478 | + url_loader_factory, config, update_callback); | ||
| 3479 | } | ||
| 3480 | |||
| 3481 | void V4LocalDatabaseManager::UpdateRequestCompleted( | ||
| 3482 | --- components/safe_browsing/core/browser/db/v4_local_database_manager.h.orig | ||
| 3483 | +++ components/safe_browsing/core/browser/db/v4_local_database_manager.h | ||
| 3484 | @@ -37,8 +37,7 @@ class V4LocalDatabaseManager : public Sa | ||
| 3485 | static scoped_refptr<V4LocalDatabaseManager> Create( | ||
| 3486 | const base::FilePath& base_path, | ||
| 3487 | scoped_refptr<base::SequencedTaskRunner> ui_task_runner, | ||
| 3488 | - scoped_refptr<base::SequencedTaskRunner> io_task_runner, | ||
| 3489 | - ExtendedReportingLevelCallback extended_reporting_level_callback); | ||
| 3490 | + scoped_refptr<base::SequencedTaskRunner> io_task_runner); | ||
| 3491 | |||
| 3492 | V4LocalDatabaseManager(const V4LocalDatabaseManager&) = delete; | ||
| 3493 | V4LocalDatabaseManager& operator=(const V4LocalDatabaseManager&) = delete; | ||
| 3494 | @@ -108,7 +107,6 @@ class V4LocalDatabaseManager : public Sa | ||
| 3495 | // Must be initialized by calling StartOnIOThread() before using. | ||
| 3496 | V4LocalDatabaseManager( | ||
| 3497 | const base::FilePath& base_path, | ||
| 3498 | - ExtendedReportingLevelCallback extended_reporting_level_callback, | ||
| 3499 | scoped_refptr<base::SequencedTaskRunner> ui_task_runner, | ||
| 3500 | scoped_refptr<base::SequencedTaskRunner> io_task_runner, | ||
| 3501 | scoped_refptr<base::SequencedTaskRunner> task_runner_for_tests); | ||
| 3502 | @@ -367,10 +365,6 @@ class V4LocalDatabaseManager : public Sa | ||
| 3503 | // ready to process next update. | ||
| 3504 | DatabaseUpdatedCallback db_updated_callback_; | ||
| 3505 | |||
| 3506 | - // Callback to get the current extended reporting level. Needed by the update | ||
| 3507 | - // manager. | ||
| 3508 | - ExtendedReportingLevelCallback extended_reporting_level_callback_; | ||
| 3509 | - | ||
| 3510 | // The client_state of each list currently being synced. This is updated each | ||
| 3511 | // time a database update completes, and used to send list client_state | ||
| 3512 | // information in the full hash request. | ||
| 3513 | --- components/safe_browsing/core/browser/db/v4_protocol_manager_util.cc.orig | ||
| 3514 | +++ components/safe_browsing/core/browser/db/v4_protocol_manager_util.cc | ||
| 3515 | @@ -88,7 +88,6 @@ void SetSbV4UrlPrefixForTesting(const ch | ||
| 3516 | |||
| 3517 | std::string GetReportUrl(const V4ProtocolConfig& config, | ||
| 3518 | const std::string& method, | ||
| 3519 | - const ExtendedReportingLevel* reporting_level, | ||
| 3520 | const bool is_enhanced_protection) { | ||
| 3521 | std::string url = base::StringPrintf( | ||
| 3522 | "%s/%s?client=%s&appver=%s&pver=4.0", kSbReportsURLPrefix, method.c_str(), | ||
| 3523 | @@ -98,8 +97,6 @@ std::string GetReportUrl(const V4Protoco | ||
| 3524 | base::StringAppendF(&url, "&key=%s", | ||
| 3525 | net::EscapeQueryParamValue(api_key, true).c_str()); | ||
| 3526 | } | ||
| 3527 | - if (reporting_level) | ||
| 3528 | - url.append(base::StringPrintf("&ext=%d", *reporting_level)); | ||
| 3529 | if (is_enhanced_protection) | ||
| 3530 | url.append(base::StringPrintf("&enh=%d", is_enhanced_protection)); | ||
| 3531 | return url; | ||
| 3532 | --- components/safe_browsing/core/browser/db/v4_protocol_manager_util.h.orig | ||
| 3533 | +++ components/safe_browsing/core/browser/db/v4_protocol_manager_util.h | ||
| 3534 | @@ -18,10 +18,11 @@ | ||
| 3535 | #include <vector> | ||
| 3536 | |||
| 3537 | #include "base/containers/flat_set.h" | ||
| 3538 | +#include "base/files/file_path.h" | ||
| 3539 | #include "base/gtest_prod_util.h" | ||
| 3540 | #include "base/strings/string_piece.h" | ||
| 3541 | +#include "base/time/time.h" | ||
| 3542 | #include "components/safe_browsing/core/browser/db/safebrowsing.pb.h" | ||
| 3543 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3544 | #include "url/gurl.h" | ||
| 3545 | |||
| 3546 | namespace net { | ||
| 3547 | @@ -88,7 +89,6 @@ V4ProtocolConfig GetV4ProtocolConfig(con | ||
| 3548 | std::string GetReportUrl( | ||
| 3549 | const V4ProtocolConfig& config, | ||
| 3550 | const std::string& method, | ||
| 3551 | - const ExtendedReportingLevel* reporting_level = nullptr, | ||
| 3552 | const bool is_enhanced_protection = false); | ||
| 3553 | |||
| 3554 | // Different types of threats that SafeBrowsing protects against. This is the | ||
| 3555 | --- components/safe_browsing/core/browser/db/v4_update_protocol_manager.cc.orig | ||
| 3556 | +++ components/safe_browsing/core/browser/db/v4_update_protocol_manager.cc | ||
| 3557 | @@ -78,19 +78,8 @@ static const int kV4TimerStartIntervalSe | ||
| 3558 | // Maximum time, in seconds, to wait for a response to an update request. | ||
| 3559 | static const int kV4TimerUpdateWaitSecMax = 15 * 60; // 15 minutes | ||
| 3560 | |||
| 3561 | -ChromeClientInfo::SafeBrowsingReportingPopulation GetReportingLevelProtoValue( | ||
| 3562 | - ExtendedReportingLevel reporting_level) { | ||
| 3563 | - switch (reporting_level) { | ||
| 3564 | - case SBER_LEVEL_OFF: | ||
| 3565 | - return ChromeClientInfo::OPT_OUT; | ||
| 3566 | - case SBER_LEVEL_LEGACY: | ||
| 3567 | - return ChromeClientInfo::EXTENDED; | ||
| 3568 | - case SBER_LEVEL_SCOUT: | ||
| 3569 | - return ChromeClientInfo::SCOUT; | ||
| 3570 | - default: | ||
| 3571 | - NOTREACHED() << "Unexpected reporting_level!"; | ||
| 3572 | - return ChromeClientInfo::UNSPECIFIED; | ||
| 3573 | - } | ||
| 3574 | +ChromeClientInfo::SafeBrowsingReportingPopulation GetReportingLevelProtoValue() { | ||
| 3575 | + return ChromeClientInfo::OPT_OUT; | ||
| 3576 | } | ||
| 3577 | |||
| 3578 | // The default V4UpdateProtocolManagerFactory. | ||
| 3579 | @@ -108,12 +97,10 @@ class V4UpdateProtocolManagerFactoryImpl | ||
| 3580 | std::unique_ptr<V4UpdateProtocolManager> CreateProtocolManager( | ||
| 3581 | scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, | ||
| 3582 | const V4ProtocolConfig& config, | ||
| 3583 | - V4UpdateCallback update_callback, | ||
| 3584 | - ExtendedReportingLevelCallback extended_reporting_level_callback) | ||
| 3585 | + V4UpdateCallback update_callback) | ||
| 3586 | override { | ||
| 3587 | return base::WrapUnique( | ||
| 3588 | - new V4UpdateProtocolManager(url_loader_factory, config, update_callback, | ||
| 3589 | - extended_reporting_level_callback)); | ||
| 3590 | + new V4UpdateProtocolManager(url_loader_factory, config, update_callback)); | ||
| 3591 | } | ||
| 3592 | }; | ||
| 3593 | |||
| 3594 | @@ -126,14 +113,12 @@ V4UpdateProtocolManagerFactory* V4Update | ||
| 3595 | std::unique_ptr<V4UpdateProtocolManager> V4UpdateProtocolManager::Create( | ||
| 3596 | scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, | ||
| 3597 | const V4ProtocolConfig& config, | ||
| 3598 | - V4UpdateCallback update_callback, | ||
| 3599 | - ExtendedReportingLevelCallback extended_reporting_level_callback) { | ||
| 3600 | + V4UpdateCallback update_callback) { | ||
| 3601 | if (!factory_) { | ||
| 3602 | factory_ = new V4UpdateProtocolManagerFactoryImpl(); | ||
| 3603 | } | ||
| 3604 | return factory_->CreateProtocolManager(url_loader_factory, config, | ||
| 3605 | - update_callback, | ||
| 3606 | - extended_reporting_level_callback); | ||
| 3607 | + update_callback); | ||
| 3608 | } | ||
| 3609 | |||
| 3610 | void V4UpdateProtocolManager::ResetUpdateErrors() { | ||
| 3611 | @@ -144,8 +129,7 @@ void V4UpdateProtocolManager::ResetUpdat | ||
| 3612 | V4UpdateProtocolManager::V4UpdateProtocolManager( | ||
| 3613 | scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, | ||
| 3614 | const V4ProtocolConfig& config, | ||
| 3615 | - V4UpdateCallback update_callback, | ||
| 3616 | - ExtendedReportingLevelCallback extended_reporting_level_callback) | ||
| 3617 | + V4UpdateCallback update_callback) | ||
| 3618 | : update_error_count_(0), | ||
| 3619 | update_back_off_mult_(1), | ||
| 3620 | next_update_interval_( | ||
| 3621 | @@ -153,8 +137,7 @@ V4UpdateProtocolManager::V4UpdateProtoco | ||
| 3622 | kV4TimerStartIntervalSecMax))), | ||
| 3623 | config_(config), | ||
| 3624 | url_loader_factory_(url_loader_factory), | ||
| 3625 | - update_callback_(update_callback), | ||
| 3626 | - extended_reporting_level_callback_(extended_reporting_level_callback) { | ||
| 3627 | + update_callback_(update_callback) { | ||
| 3628 | // Do not auto-schedule updates. Let the owner (V4LocalDatabaseManager) do it | ||
| 3629 | // when it is ready to process updates. | ||
| 3630 | } | ||
| 3631 | @@ -249,11 +232,6 @@ std::string V4UpdateProtocolManager::Get | ||
| 3632 | RICE); | ||
| 3633 | } | ||
| 3634 | |||
| 3635 | - if (!extended_reporting_level_callback_.is_null()) { | ||
| 3636 | - request.mutable_chrome_client_info()->set_reporting_population( | ||
| 3637 | - GetReportingLevelProtoValue(extended_reporting_level_callback_.Run())); | ||
| 3638 | - } | ||
| 3639 | - | ||
| 3640 | V4ProtocolManagerUtil::SetClientInfoFromConfig(request.mutable_client(), | ||
| 3641 | config_); | ||
| 3642 | |||
| 3643 | --- components/safe_browsing/core/browser/db/v4_update_protocol_manager.h.orig | ||
| 3644 | +++ components/safe_browsing/core/browser/db/v4_update_protocol_manager.h | ||
| 3645 | @@ -24,7 +24,6 @@ | ||
| 3646 | #include "components/safe_browsing/core/browser/db/util.h" | ||
| 3647 | #include "components/safe_browsing/core/browser/db/v4_protocol_manager_util.h" | ||
| 3648 | #include "components/safe_browsing/core/common/proto/webui.pb.h" | ||
| 3649 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3650 | #include "third_party/abseil-cpp/absl/types/optional.h" | ||
| 3651 | |||
| 3652 | class GURL; | ||
| 3653 | @@ -45,9 +44,6 @@ class V4UpdateProtocolManagerFactory; | ||
| 3654 | using V4UpdateCallback = | ||
| 3655 | base::RepeatingCallback<void(std::unique_ptr<ParsedServerResponse>)>; | ||
| 3656 | |||
| 3657 | -using ExtendedReportingLevelCallback = | ||
| 3658 | - base::RepeatingCallback<ExtendedReportingLevel()>; | ||
| 3659 | - | ||
| 3660 | class V4UpdateProtocolManager { | ||
| 3661 | public: | ||
| 3662 | V4UpdateProtocolManager(const V4UpdateProtocolManager&) = delete; | ||
| 3663 | @@ -65,8 +61,7 @@ class V4UpdateProtocolManager { | ||
| 3664 | static std::unique_ptr<V4UpdateProtocolManager> Create( | ||
| 3665 | scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, | ||
| 3666 | const V4ProtocolConfig& config, | ||
| 3667 | - V4UpdateCallback update_callback, | ||
| 3668 | - ExtendedReportingLevelCallback extended_reporting_level_callback); | ||
| 3669 | + V4UpdateCallback update_callback); | ||
| 3670 | |||
| 3671 | void OnURLLoaderComplete(std::unique_ptr<std::string> response_body); | ||
| 3672 | |||
| 3673 | @@ -88,8 +83,7 @@ class V4UpdateProtocolManager { | ||
| 3674 | V4UpdateProtocolManager( | ||
| 3675 | scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, | ||
| 3676 | const V4ProtocolConfig& config, | ||
| 3677 | - V4UpdateCallback update_callback, | ||
| 3678 | - ExtendedReportingLevelCallback extended_reporting_level_callback); | ||
| 3679 | + V4UpdateCallback update_callback); | ||
| 3680 | |||
| 3681 | private: | ||
| 3682 | FRIEND_TEST_ALL_PREFIXES(V4UpdateProtocolManagerTest, | ||
| 3683 | @@ -207,8 +201,6 @@ class V4UpdateProtocolManager { | ||
| 3684 | // complete. | ||
| 3685 | base::OneShotTimer timeout_timer_; | ||
| 3686 | |||
| 3687 | - ExtendedReportingLevelCallback extended_reporting_level_callback_; | ||
| 3688 | - | ||
| 3689 | SEQUENCE_CHECKER(sequence_checker_); | ||
| 3690 | }; | ||
| 3691 | |||
| 3692 | @@ -226,8 +218,7 @@ class V4UpdateProtocolManagerFactory { | ||
| 3693 | virtual std::unique_ptr<V4UpdateProtocolManager> CreateProtocolManager( | ||
| 3694 | scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, | ||
| 3695 | const V4ProtocolConfig& config, | ||
| 3696 | - V4UpdateCallback update_callback, | ||
| 3697 | - ExtendedReportingLevelCallback extended_reporting_level_callback) = 0; | ||
| 3698 | + V4UpdateCallback update_callback) = 0; | ||
| 3699 | }; | ||
| 3700 | |||
| 3701 | } // namespace safe_browsing | ||
| 3702 | --- components/safe_browsing/core/browser/password_protection/password_protection_service_base.h.orig | ||
| 3703 | +++ components/safe_browsing/core/browser/password_protection/password_protection_service_base.h | ||
| 3704 | @@ -28,7 +28,6 @@ | ||
| 3705 | #include "components/safe_browsing/core/browser/safe_browsing_metrics_collector.h" | ||
| 3706 | #include "components/safe_browsing/core/browser/safe_browsing_token_fetcher.h" | ||
| 3707 | #include "components/safe_browsing/core/common/proto/csd.pb.h" | ||
| 3708 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3709 | #include "components/sessions/core/session_id.h" | ||
| 3710 | #include "components/signin/public/identity_manager/account_info.h" | ||
| 3711 | #include "components/signin/public/identity_manager/identity_manager.h" | ||
| 3712 | @@ -149,10 +148,6 @@ class PasswordProtectionServiceBase : pu | ||
| 3713 | // Returns if the warning UI is enabled. | ||
| 3714 | bool IsWarningEnabled(ReusedPasswordAccountType password_type); | ||
| 3715 | |||
| 3716 | - // Returns the pref value of password protection warning trigger. | ||
| 3717 | - virtual PasswordProtectionTrigger GetPasswordProtectionWarningTriggerPref( | ||
| 3718 | - ReusedPasswordAccountType password_type) const = 0; | ||
| 3719 | - | ||
| 3720 | // If |url| matches Safe Browsing allowlist domains, password protection | ||
| 3721 | // change password URL, or password protection login URLs in the enterprise | ||
| 3722 | // policy. | ||
| 3723 | --- components/safe_browsing/core/browser/ping_manager.cc.orig | ||
| 3724 | +++ components/safe_browsing/core/browser/ping_manager.cc | ||
| 3725 | @@ -141,7 +141,7 @@ GURL PingManager::SafeBrowsingHitUrl( | ||
| 3726 | hit_report.threat_type == SB_THREAT_TYPE_URL_CLIENT_SIDE_PHISHING || | ||
| 3727 | hit_report.threat_type == SB_THREAT_TYPE_URL_CLIENT_SIDE_MALWARE); | ||
| 3728 | std::string url = | ||
| 3729 | - GetReportUrl(config_, "report", &hit_report.extended_reporting_level, | ||
| 3730 | + GetReportUrl(config_, "report", | ||
| 3731 | hit_report.is_enhanced_protection); | ||
| 3732 | std::string threat_list = "none"; | ||
| 3733 | switch (hit_report.threat_type) { | ||
| 3734 | --- components/safe_browsing/core/browser/realtime/policy_engine.cc.orig | ||
| 3735 | +++ components/safe_browsing/core/browser/realtime/policy_engine.cc | ||
| 3736 | @@ -8,7 +8,6 @@ | ||
| 3737 | #include "base/metrics/histogram_macros.h" | ||
| 3738 | #include "build/build_config.h" | ||
| 3739 | #include "components/prefs/pref_service.h" | ||
| 3740 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3741 | #include "components/safe_browsing/core/common/utils.h" | ||
| 3742 | #include "components/unified_consent/pref_names.h" | ||
| 3743 | #include "components/user_prefs/user_prefs.h" | ||
| 3744 | @@ -35,7 +34,7 @@ bool RealTimePolicyEngine::IsUserMbbOpte | ||
| 3745 | |||
| 3746 | // static | ||
| 3747 | bool RealTimePolicyEngine::IsUserEpOptedIn(PrefService* pref_service) { | ||
| 3748 | - return IsEnhancedProtectionEnabled(*pref_service); | ||
| 3749 | + return false; | ||
| 3750 | } | ||
| 3751 | |||
| 3752 | // static | ||
| 3753 | @@ -81,9 +80,7 @@ bool RealTimePolicyEngine::CanPerformEnt | ||
| 3754 | return false; | ||
| 3755 | } | ||
| 3756 | |||
| 3757 | - return pref_service->GetInteger( | ||
| 3758 | - prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckMode) == | ||
| 3759 | - REAL_TIME_CHECK_FOR_MAINFRAME_ENABLED; | ||
| 3760 | + return false; | ||
| 3761 | } | ||
| 3762 | |||
| 3763 | // static | ||
| 3764 | --- components/safe_browsing/core/browser/realtime/url_lookup_service.cc.orig | ||
| 3765 | +++ components/safe_browsing/core/browser/realtime/url_lookup_service.cc | ||
| 3766 | @@ -19,7 +19,6 @@ | ||
| 3767 | #include "components/safe_browsing/core/browser/referrer_chain_provider.h" | ||
| 3768 | #include "components/safe_browsing/core/browser/safe_browsing_token_fetcher.h" | ||
| 3769 | #include "components/safe_browsing/core/common/features.h" | ||
| 3770 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3771 | #include "components/unified_consent/pref_names.h" | ||
| 3772 | #include "net/base/ip_address.h" | ||
| 3773 | #include "net/base/load_flags.h" | ||
| 3774 | @@ -61,10 +60,6 @@ RealTimeUrlLookupService::RealTimeUrlLoo | ||
| 3775 | variations_(variations_service) { | ||
| 3776 | pref_change_registrar_.Init(pref_service_); | ||
| 3777 | pref_change_registrar_.Add( | ||
| 3778 | - prefs::kSafeBrowsingEnhanced, | ||
| 3779 | - base::BindRepeating(&RealTimeUrlLookupService::OnPrefChanged, | ||
| 3780 | - base::Unretained(this))); | ||
| 3781 | - pref_change_registrar_.Add( | ||
| 3782 | unified_consent::prefs::kUrlKeyedAnonymizedDataCollectionEnabled, | ||
| 3783 | base::BindRepeating(&RealTimeUrlLookupService::OnPrefChanged, | ||
| 3784 | base::Unretained(this))); | ||
| 3785 | @@ -144,7 +139,7 @@ bool RealTimeUrlLookupService::CanSendPa | ||
| 3786 | } | ||
| 3787 | |||
| 3788 | bool RealTimeUrlLookupService::CanCheckSubresourceURL() const { | ||
| 3789 | - return IsEnhancedProtectionEnabled(*pref_service_); | ||
| 3790 | + return false; | ||
| 3791 | } | ||
| 3792 | |||
| 3793 | bool RealTimeUrlLookupService::CanCheckSafeBrowsingDb() const { | ||
| 3794 | --- components/safe_browsing/core/browser/realtime/url_lookup_service_base.cc.orig | ||
| 3795 | +++ components/safe_browsing/core/browser/realtime/url_lookup_service_base.cc | ||
| 3796 | @@ -16,7 +16,6 @@ | ||
| 3797 | #include "components/prefs/pref_service.h" | ||
| 3798 | #include "components/safe_browsing/core/browser/referrer_chain_provider.h" | ||
| 3799 | #include "components/safe_browsing/core/browser/verdict_cache_manager.h" | ||
| 3800 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3801 | #include "components/safe_browsing/core/common/safebrowsing_constants.h" | ||
| 3802 | #include "components/safe_browsing/core/common/utils.h" | ||
| 3803 | #include "net/base/ip_address.h" | ||
| 3804 | --- components/safe_browsing/core/browser/safe_browsing_metrics_collector.cc.orig | ||
| 3805 | +++ components/safe_browsing/core/browser/safe_browsing_metrics_collector.cc | ||
| 3806 | @@ -11,13 +11,11 @@ | ||
| 3807 | #include "base/time/time.h" | ||
| 3808 | #include "components/prefs/pref_service.h" | ||
| 3809 | #include "components/prefs/scoped_user_pref_update.h" | ||
| 3810 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 3811 | |||
| 3812 | namespace { | ||
| 3813 | |||
| 3814 | using EventType = safe_browsing::SafeBrowsingMetricsCollector::EventType; | ||
| 3815 | using UserState = safe_browsing::SafeBrowsingMetricsCollector::UserState; | ||
| 3816 | -using SafeBrowsingState = safe_browsing::SafeBrowsingState; | ||
| 3817 | |||
| 3818 | const int kMetricsLoggingIntervalDay = 1; | ||
| 3819 | |||
| 3820 | @@ -54,11 +52,6 @@ SafeBrowsingMetricsCollector::SafeBrowsi | ||
| 3821 | PrefService* pref_service) | ||
| 3822 | : pref_service_(pref_service) { | ||
| 3823 | pref_change_registrar_.Init(pref_service_); | ||
| 3824 | - pref_change_registrar_.Add( | ||
| 3825 | - prefs::kSafeBrowsingEnhanced, | ||
| 3826 | - base::BindRepeating( | ||
| 3827 | - &SafeBrowsingMetricsCollector::OnEnhancedProtectionPrefChanged, | ||
| 3828 | - base::Unretained(this))); | ||
| 3829 | } | ||
| 3830 | |||
| 3831 | void SafeBrowsingMetricsCollector::Shutdown() { | ||
| 3832 | @@ -66,16 +59,6 @@ void SafeBrowsingMetricsCollector::Shutd | ||
| 3833 | } | ||
| 3834 | |||
| 3835 | void SafeBrowsingMetricsCollector::StartLogging() { | ||
| 3836 | - base::TimeDelta log_interval = base::Days(kMetricsLoggingIntervalDay); | ||
| 3837 | - base::Time last_log_time = | ||
| 3838 | - base::Time::FromDeltaSinceWindowsEpoch(base::Seconds( | ||
| 3839 | - pref_service_->GetInt64(prefs::kSafeBrowsingMetricsLastLogTime))); | ||
| 3840 | - base::TimeDelta delay = base::Time::Now() - last_log_time; | ||
| 3841 | - if (delay >= log_interval) { | ||
| 3842 | - LogMetricsAndScheduleNextLogging(); | ||
| 3843 | - } else { | ||
| 3844 | - ScheduleNextLoggingAfterInterval(log_interval - delay); | ||
| 3845 | - } | ||
| 3846 | } | ||
| 3847 | |||
| 3848 | void SafeBrowsingMetricsCollector::LogMetricsAndScheduleNextLogging() { | ||
| 3849 | @@ -83,9 +66,6 @@ void SafeBrowsingMetricsCollector::LogMe | ||
| 3850 | LogDailyEventMetrics(); | ||
| 3851 | RemoveOldEventsFromPref(); | ||
| 3852 | |||
| 3853 | - pref_service_->SetInt64( | ||
| 3854 | - prefs::kSafeBrowsingMetricsLastLogTime, | ||
| 3855 | - base::Time::Now().ToDeltaSinceWindowsEpoch().InSeconds()); | ||
| 3856 | ScheduleNextLoggingAfterInterval(base::Days(kMetricsLoggingIntervalDay)); | ||
| 3857 | } | ||
| 3858 | |||
| 3859 | @@ -98,181 +78,40 @@ void SafeBrowsingMetricsCollector::Sched | ||
| 3860 | } | ||
| 3861 | |||
| 3862 | void SafeBrowsingMetricsCollector::LogDailyOptInMetrics() { | ||
| 3863 | - base::UmaHistogramEnumeration("SafeBrowsing.Pref.Daily.SafeBrowsingState", | ||
| 3864 | - GetSafeBrowsingState(*pref_service_)); | ||
| 3865 | - base::UmaHistogramBoolean("SafeBrowsing.Pref.Daily.Extended", | ||
| 3866 | - IsExtendedReportingEnabled(*pref_service_)); | ||
| 3867 | - base::UmaHistogramBoolean("SafeBrowsing.Pref.Daily.SafeBrowsingModeManaged", | ||
| 3868 | - IsSafeBrowsingPolicyManaged(*pref_service_)); | ||
| 3869 | } | ||
| 3870 | |||
| 3871 | void SafeBrowsingMetricsCollector::LogDailyEventMetrics() { | ||
| 3872 | - SafeBrowsingState sb_state = GetSafeBrowsingState(*pref_service_); | ||
| 3873 | - if (sb_state == SafeBrowsingState::NO_SAFE_BROWSING) { | ||
| 3874 | - return; | ||
| 3875 | - } | ||
| 3876 | - UserState user_state = GetUserState(); | ||
| 3877 | - | ||
| 3878 | - int total_bypass_count = 0; | ||
| 3879 | - int total_security_sensitive_event_count = 0; | ||
| 3880 | - for (int event_type_int = 0; event_type_int <= EventType::kMaxValue; | ||
| 3881 | - event_type_int += 1) { | ||
| 3882 | - EventType event_type = static_cast<EventType>(event_type_int); | ||
| 3883 | - if (IsBypassEventType(event_type)) { | ||
| 3884 | - int bypass_count = GetEventCountSince(user_state, event_type, | ||
| 3885 | - base::Time::Now() - base::Days(28)); | ||
| 3886 | - base::UmaHistogramCounts100("SafeBrowsing.Daily.BypassCountLast28Days." + | ||
| 3887 | - GetUserStateMetricSuffix(user_state) + | ||
| 3888 | - "." + | ||
| 3889 | - GetEventTypeMetricSuffix(event_type), | ||
| 3890 | - bypass_count); | ||
| 3891 | - total_bypass_count += bypass_count; | ||
| 3892 | - } | ||
| 3893 | - if (IsSecuritySensitiveEventType(event_type)) { | ||
| 3894 | - int security_sensitive_event_count = GetEventCountSince( | ||
| 3895 | - user_state, event_type, base::Time::Now() - base::Days(28)); | ||
| 3896 | - base::UmaHistogramCounts100( | ||
| 3897 | - "SafeBrowsing.Daily.SecuritySensitiveCountLast28Days." + | ||
| 3898 | - GetUserStateMetricSuffix(user_state) + "." + | ||
| 3899 | - GetEventTypeMetricSuffix(event_type), | ||
| 3900 | - security_sensitive_event_count); | ||
| 3901 | - total_security_sensitive_event_count += security_sensitive_event_count; | ||
| 3902 | - } | ||
| 3903 | - } | ||
| 3904 | - base::UmaHistogramCounts100("SafeBrowsing.Daily.BypassCountLast28Days." + | ||
| 3905 | - GetUserStateMetricSuffix(user_state) + | ||
| 3906 | - ".AllEvents", | ||
| 3907 | - total_bypass_count); | ||
| 3908 | - base::UmaHistogramCounts100( | ||
| 3909 | - "SafeBrowsing.Daily.SecuritySensitiveCountLast28Days." + | ||
| 3910 | - GetUserStateMetricSuffix(user_state) + ".AllEvents", | ||
| 3911 | - total_security_sensitive_event_count); | ||
| 3912 | } | ||
| 3913 | |||
| 3914 | void SafeBrowsingMetricsCollector::RemoveOldEventsFromPref() { | ||
| 3915 | - DictionaryPrefUpdate update(pref_service_, | ||
| 3916 | - prefs::kSafeBrowsingEventTimestamps); | ||
| 3917 | - base::DictionaryValue* mutable_state_dict = update.Get(); | ||
| 3918 | - bool is_pref_valid = mutable_state_dict->is_dict(); | ||
| 3919 | - base::UmaHistogramBoolean("SafeBrowsing.MetricsCollector.IsPrefValid", | ||
| 3920 | - is_pref_valid); | ||
| 3921 | - if (!is_pref_valid) { | ||
| 3922 | - return; | ||
| 3923 | - } | ||
| 3924 | - | ||
| 3925 | - for (auto state_map : mutable_state_dict->DictItems()) { | ||
| 3926 | - for (auto event_map : state_map.second.DictItems()) { | ||
| 3927 | - event_map.second.EraseListValueIf([&](const auto& timestamp) { | ||
| 3928 | - return base::Time::Now() - PrefValueToTime(timestamp) > | ||
| 3929 | - base::Days(kEventMaxDurationDay); | ||
| 3930 | - }); | ||
| 3931 | - } | ||
| 3932 | - } | ||
| 3933 | } | ||
| 3934 | |||
| 3935 | void SafeBrowsingMetricsCollector::AddSafeBrowsingEventToPref( | ||
| 3936 | EventType event_type) { | ||
| 3937 | - SafeBrowsingState sb_state = GetSafeBrowsingState(*pref_service_); | ||
| 3938 | - // Skip the event if Safe Browsing is disabled. | ||
| 3939 | - if (sb_state == SafeBrowsingState::NO_SAFE_BROWSING) { | ||
| 3940 | - return; | ||
| 3941 | - } | ||
| 3942 | - | ||
| 3943 | - AddSafeBrowsingEventAndUserStateToPref(GetUserState(), event_type); | ||
| 3944 | } | ||
| 3945 | |||
| 3946 | absl::optional<base::Time> | ||
| 3947 | SafeBrowsingMetricsCollector::GetLatestEventTimestamp(EventType event_type) { | ||
| 3948 | - // Events are not logged when Safe Browsing is disabled. | ||
| 3949 | - SafeBrowsingState sb_state = GetSafeBrowsingState(*pref_service_); | ||
| 3950 | - if (sb_state == SafeBrowsingState::NO_SAFE_BROWSING) { | ||
| 3951 | return absl::nullopt; | ||
| 3952 | - } | ||
| 3953 | - | ||
| 3954 | - const absl::optional<Event> event = | ||
| 3955 | - GetLatestEventFromEventType(GetUserState(), event_type); | ||
| 3956 | - return event ? absl::optional<base::Time>(event.value().timestamp) | ||
| 3957 | - : absl::nullopt; | ||
| 3958 | } | ||
| 3959 | |||
| 3960 | absl::optional<base::Time> | ||
| 3961 | SafeBrowsingMetricsCollector::GetLatestSecuritySensitiveEventTimestamp() { | ||
| 3962 | - std::vector<absl::optional<base::Time>> security_sensitive_event_times{ | ||
| 3963 | - GetLatestEventTimestamp(SECURITY_SENSITIVE_SAFE_BROWSING_INTERSTITIAL), | ||
| 3964 | - GetLatestEventTimestamp(SECURITY_SENSITIVE_SSL_INTERSTITIAL), | ||
| 3965 | - GetLatestEventTimestamp(SECURITY_SENSITIVE_PASSWORD_PROTECTION), | ||
| 3966 | - GetLatestEventTimestamp(SECURITY_SENSITIVE_DOWNLOAD)}; | ||
| 3967 | absl::optional<base::Time> latest_event_time = absl::nullopt; | ||
| 3968 | - for (absl::optional<base::Time> security_sensitive_event_time : | ||
| 3969 | - security_sensitive_event_times) { | ||
| 3970 | - if (!security_sensitive_event_time) { | ||
| 3971 | - continue; | ||
| 3972 | - } | ||
| 3973 | - if (!latest_event_time || | ||
| 3974 | - (latest_event_time.value() < security_sensitive_event_time.value())) { | ||
| 3975 | - latest_event_time = security_sensitive_event_time; | ||
| 3976 | - } | ||
| 3977 | - } | ||
| 3978 | return latest_event_time; | ||
| 3979 | } | ||
| 3980 | |||
| 3981 | void SafeBrowsingMetricsCollector::AddSafeBrowsingEventAndUserStateToPref( | ||
| 3982 | UserState user_state, | ||
| 3983 | EventType event_type) { | ||
| 3984 | - DictionaryPrefUpdate update(pref_service_, | ||
| 3985 | - prefs::kSafeBrowsingEventTimestamps); | ||
| 3986 | - base::DictionaryValue* mutable_state_dict = update.Get(); | ||
| 3987 | - | ||
| 3988 | - base::Value* event_dict = | ||
| 3989 | - mutable_state_dict->FindDictKey(UserStateToPrefKey(user_state)); | ||
| 3990 | - if (!event_dict) { | ||
| 3991 | - event_dict = | ||
| 3992 | - mutable_state_dict->SetKey(UserStateToPrefKey(user_state), | ||
| 3993 | - base::Value(base::Value::Type::DICTIONARY)); | ||
| 3994 | - } | ||
| 3995 | - | ||
| 3996 | - base::Value* timestamps = | ||
| 3997 | - event_dict->FindListKey(EventTypeToPrefKey(event_type)); | ||
| 3998 | - if (!timestamps) { | ||
| 3999 | - timestamps = event_dict->SetKey(EventTypeToPrefKey(event_type), | ||
| 4000 | - base::Value(base::Value::Type::LIST)); | ||
| 4001 | - } | ||
| 4002 | - | ||
| 4003 | - // Remove the oldest timestamp if the length of the timestamps hits the limit. | ||
| 4004 | - while (timestamps->GetList().size() >= kTimestampsMaxLength) { | ||
| 4005 | - timestamps->EraseListIter(timestamps->GetList().begin()); | ||
| 4006 | - } | ||
| 4007 | - | ||
| 4008 | - timestamps->Append(TimeToPrefValue(base::Time::Now())); | ||
| 4009 | } | ||
| 4010 | |||
| 4011 | void SafeBrowsingMetricsCollector::OnEnhancedProtectionPrefChanged() { | ||
| 4012 | - // Pref changed by policy is not initiated by users, so this case is ignored. | ||
| 4013 | - if (IsSafeBrowsingPolicyManaged(*pref_service_)) { | ||
| 4014 | - return; | ||
| 4015 | - } | ||
| 4016 | - | ||
| 4017 | - if (!pref_service_->GetBoolean(prefs::kSafeBrowsingEnhanced)) { | ||
| 4018 | - AddSafeBrowsingEventAndUserStateToPref(UserState::kEnhancedProtection, | ||
| 4019 | - EventType::USER_STATE_DISABLED); | ||
| 4020 | - int disabled_times_last_week = GetEventCountSince( | ||
| 4021 | - UserState::kEnhancedProtection, EventType::USER_STATE_DISABLED, | ||
| 4022 | - base::Time::Now() - base::Days(7)); | ||
| 4023 | - if (disabled_times_last_week <= kEsbDisabledMetricsQuota) { | ||
| 4024 | - LogEnhancedProtectionDisabledMetrics(); | ||
| 4025 | - } | ||
| 4026 | - } else { | ||
| 4027 | - AddSafeBrowsingEventAndUserStateToPref(UserState::kEnhancedProtection, | ||
| 4028 | - EventType::USER_STATE_ENABLED); | ||
| 4029 | - } | ||
| 4030 | } | ||
| 4031 | |||
| 4032 | const base::Value* SafeBrowsingMetricsCollector::GetSafeBrowsingEventDictionary( | ||
| 4033 | UserState user_state) { | ||
| 4034 | - const base::DictionaryValue* state_dict = | ||
| 4035 | - pref_service_->GetDictionary(prefs::kSafeBrowsingEventTimestamps); | ||
| 4036 | - | ||
| 4037 | - return state_dict->FindDictKey(UserStateToPrefKey(user_state)); | ||
| 4038 | + return nullptr; | ||
| 4039 | } | ||
| 4040 | |||
| 4041 | absl::optional<SafeBrowsingMetricsCollector::Event> | ||
| 4042 | @@ -370,20 +209,7 @@ int SafeBrowsingMetricsCollector::GetEve | ||
| 4043 | } | ||
| 4044 | |||
| 4045 | UserState SafeBrowsingMetricsCollector::GetUserState() { | ||
| 4046 | - if (IsSafeBrowsingPolicyManaged(*pref_service_)) { | ||
| 4047 | - return UserState::kManaged; | ||
| 4048 | - } | ||
| 4049 | - | ||
| 4050 | - SafeBrowsingState sb_state = GetSafeBrowsingState(*pref_service_); | ||
| 4051 | - switch (sb_state) { | ||
| 4052 | - case SafeBrowsingState::ENHANCED_PROTECTION: | ||
| 4053 | - return UserState::kEnhancedProtection; | ||
| 4054 | - case SafeBrowsingState::STANDARD_PROTECTION: | ||
| 4055 | - return UserState::kStandardProtection; | ||
| 4056 | - case SafeBrowsingState::NO_SAFE_BROWSING: | ||
| 4057 | - NOTREACHED() << "Unexpected Safe Browsing state."; | ||
| 4058 | - return UserState::kStandardProtection; | ||
| 4059 | - } | ||
| 4060 | + NOTREACHED() << "Unexpected Safe Browsing state."; | ||
| 4061 | } | ||
| 4062 | |||
| 4063 | bool SafeBrowsingMetricsCollector::IsBypassEventType(const EventType& type) { | ||
| 4064 | --- components/safe_browsing/core/common/BUILD.gn.orig | ||
| 4065 | +++ components/safe_browsing/core/common/BUILD.gn | ||
| 4066 | @@ -6,20 +6,8 @@ import("//build/config/features.gni") | ||
| 4067 | import("//components/safe_browsing/buildflags.gni") | ||
| 4068 | import("//mojo/public/tools/bindings/mojom.gni") | ||
| 4069 | |||
| 4070 | -static_library("safe_browsing_prefs") { | ||
| 4071 | - sources = [ | ||
| 4072 | - "safe_browsing_prefs.cc", | ||
| 4073 | - "safe_browsing_prefs.h", | ||
| 4074 | - ] | ||
| 4075 | - | ||
| 4076 | - deps = [ | ||
| 4077 | - ":common", | ||
| 4078 | - "//components/pref_registry:pref_registry", | ||
| 4079 | - "//components/prefs", | ||
| 4080 | - "//net:net", | ||
| 4081 | - ] | ||
| 4082 | - | ||
| 4083 | - public_deps = [ "//base" ] | ||
| 4084 | +group("safe_browsing_prefs") { | ||
| 4085 | + # SafeBrowsing prefs are disabled | ||
| 4086 | } | ||
| 4087 | |||
| 4088 | source_set("safe_browsing_policy_handler") { | ||
| 4089 | --- components/safe_browsing/core/common/safe_browsing_policy_handler.cc.orig | ||
| 4090 | +++ components/safe_browsing/core/common/safe_browsing_policy_handler.cc | ||
| 4091 | @@ -11,7 +11,6 @@ | ||
| 4092 | #include "components/policy/policy_constants.h" | ||
| 4093 | #include "components/prefs/pref_service.h" | ||
| 4094 | #include "components/prefs/pref_value_map.h" | ||
| 4095 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 4096 | #include "components/strings/grit/components_strings.h" | ||
| 4097 | #include "third_party/abseil-cpp/absl/types/optional.h" | ||
| 4098 | |||
| 4099 | @@ -172,34 +171,14 @@ void SafeBrowsingPolicyHandler::ApplyPol | ||
| 4100 | |||
| 4101 | if (!value.has_value()) | ||
| 4102 | return; | ||
| 4103 | - | ||
| 4104 | - switch (value.value()) { | ||
| 4105 | - case ProtectionLevel::kNoProtection: | ||
| 4106 | - prefs->SetBoolean(prefs::kSafeBrowsingEnabled, false); | ||
| 4107 | - prefs->SetBoolean(prefs::kSafeBrowsingEnhanced, false); | ||
| 4108 | - return; | ||
| 4109 | - case ProtectionLevel::kStandardProtection: | ||
| 4110 | - prefs->SetBoolean(prefs::kSafeBrowsingEnabled, true); | ||
| 4111 | - prefs->SetBoolean(prefs::kSafeBrowsingEnhanced, false); | ||
| 4112 | - return; | ||
| 4113 | - case ProtectionLevel::kEnhancedProtection: | ||
| 4114 | - // |kSafeBrowsingEnhanced| is enabled, but so is | ||
| 4115 | - // |kSafeBrowsingEnabled| because the extensions API should see Safe | ||
| 4116 | - // Browsing as enabled. See https://crbug.com/1064722 for more background. | ||
| 4117 | - prefs->SetBoolean(prefs::kSafeBrowsingEnabled, true); | ||
| 4118 | - prefs->SetBoolean(prefs::kSafeBrowsingEnhanced, true); | ||
| 4119 | - return; | ||
| 4120 | - } | ||
| 4121 | } | ||
| 4122 | |||
| 4123 | // static | ||
| 4124 | SafeBrowsingPolicyHandler::ProtectionLevel | ||
| 4125 | SafeBrowsingPolicyHandler::GetSafeBrowsingProtectionLevel( | ||
| 4126 | const PrefService* pref_sevice) { | ||
| 4127 | - bool safe_browsing_enhanced = | ||
| 4128 | - pref_sevice->GetBoolean(prefs::kSafeBrowsingEnhanced); | ||
| 4129 | - bool safe_browsing_enabled = | ||
| 4130 | - pref_sevice->GetBoolean(prefs::kSafeBrowsingEnabled); | ||
| 4131 | + bool safe_browsing_enhanced = false; | ||
| 4132 | + bool safe_browsing_enabled = false; | ||
| 4133 | |||
| 4134 | if (safe_browsing_enhanced) | ||
| 4135 | return ProtectionLevel::kEnhancedProtection; | ||
| 4136 | @@ -213,10 +192,8 @@ SafeBrowsingPolicyHandler::GetSafeBrowsi | ||
| 4137 | // static | ||
| 4138 | bool SafeBrowsingPolicyHandler::IsSafeBrowsingProtectionLevelSetByPolicy( | ||
| 4139 | const PrefService* pref_service) { | ||
| 4140 | - bool is_safe_browsing_enabled_managed = | ||
| 4141 | - pref_service->IsManagedPreference(prefs::kSafeBrowsingEnabled); | ||
| 4142 | - bool is_safe_browsing_enhanced_managed = | ||
| 4143 | - pref_service->IsManagedPreference(prefs::kSafeBrowsingEnhanced); | ||
| 4144 | + bool is_safe_browsing_enabled_managed = false; | ||
| 4145 | + bool is_safe_browsing_enhanced_managed = false; | ||
| 4146 | DCHECK_EQ(is_safe_browsing_enabled_managed, | ||
| 4147 | is_safe_browsing_enhanced_managed); | ||
| 4148 | return is_safe_browsing_enabled_managed && is_safe_browsing_enhanced_managed; | ||
| 4149 | --- components/safe_browsing/core/common/safe_browsing_prefs_unittest.cc.orig | ||
| 4150 | +++ components/safe_browsing/core/common/safe_browsing_prefs_unittest.cc | ||
| 4151 | @@ -12,7 +12,6 @@ | ||
| 4152 | #include "components/prefs/pref_registry_simple.h" | ||
| 4153 | #include "components/prefs/testing_pref_service.h" | ||
| 4154 | #include "components/safe_browsing/core/common/features.h" | ||
| 4155 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 4156 | #include "testing/gtest/include/gtest/gtest.h" | ||
| 4157 | #include "url/gurl.h" | ||
| 4158 | |||
| 4159 | --- components/safety_check/safety_check.cc.orig | ||
| 4160 | +++ components/safety_check/safety_check.cc | ||
| 4161 | @@ -4,26 +4,9 @@ | ||
| 4162 | |||
| 4163 | #include "components/safety_check/safety_check.h" | ||
| 4164 | |||
| 4165 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 4166 | - | ||
| 4167 | namespace safety_check { | ||
| 4168 | |||
| 4169 | SafeBrowsingStatus CheckSafeBrowsing(PrefService* pref_service) { | ||
| 4170 | - const PrefService::Preference* enabled_pref = | ||
| 4171 | - pref_service->FindPreference(prefs::kSafeBrowsingEnabled); | ||
| 4172 | - bool is_sb_enabled = pref_service->GetBoolean(prefs::kSafeBrowsingEnabled); | ||
| 4173 | - bool is_sb_managed = enabled_pref->IsManaged(); | ||
| 4174 | - | ||
| 4175 | - if (is_sb_enabled && pref_service->GetBoolean(prefs::kSafeBrowsingEnhanced)) | ||
| 4176 | - return SafeBrowsingStatus::kEnabledEnhanced; | ||
| 4177 | - if (is_sb_enabled && is_sb_managed) | ||
| 4178 | - return SafeBrowsingStatus::kEnabledStandard; | ||
| 4179 | - if (is_sb_enabled && !is_sb_managed) | ||
| 4180 | - return SafeBrowsingStatus::kEnabledStandardAvailableEnhanced; | ||
| 4181 | - if (is_sb_managed) | ||
| 4182 | - return SafeBrowsingStatus::kDisabledByAdmin; | ||
| 4183 | - if (enabled_pref->IsExtensionControlled()) | ||
| 4184 | - return SafeBrowsingStatus::kDisabledByExtension; | ||
| 4185 | return SafeBrowsingStatus::kDisabled; | ||
| 4186 | } | ||
| 4187 | |||
| 4188 | --- components/security_interstitials/content/bad_clock_blocking_page.cc.orig | ||
| 4189 | +++ components/security_interstitials/content/bad_clock_blocking_page.cc | ||
| 4190 | @@ -7,7 +7,6 @@ | ||
| 4191 | #include <utility> | ||
| 4192 | |||
| 4193 | #include "base/strings/string_number_conversions.h" | ||
| 4194 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 4195 | #include "components/security_interstitials/content/cert_report_helper.h" | ||
| 4196 | #include "components/security_interstitials/content/security_interstitial_controller_client.h" | ||
| 4197 | #include "components/security_interstitials/content/security_interstitial_page.h" | ||
| 4198 | --- components/security_interstitials/content/captive_portal_blocking_page.cc.orig | ||
| 4199 | +++ components/security_interstitials/content/captive_portal_blocking_page.cc | ||
| 4200 | @@ -15,7 +15,6 @@ | ||
| 4201 | #include "build/build_config.h" | ||
| 4202 | #include "components/captive_portal/core/captive_portal_detector.h" | ||
| 4203 | #include "components/captive_portal/core/captive_portal_metrics.h" | ||
| 4204 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 4205 | #include "components/security_interstitials/content/cert_report_helper.h" | ||
| 4206 | #include "components/security_interstitials/content/security_interstitial_controller_client.h" | ||
| 4207 | #include "components/security_interstitials/content/ssl_cert_reporter.h" | ||
| 4208 | --- components/security_interstitials/content/cert_report_helper.cc.orig | ||
| 4209 | +++ components/security_interstitials/content/cert_report_helper.cc | ||
| 4210 | @@ -14,7 +14,6 @@ | ||
| 4211 | #include "build/branding_buildflags.h" | ||
| 4212 | #include "build/build_config.h" | ||
| 4213 | #include "components/prefs/pref_service.h" | ||
| 4214 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 4215 | #include "components/security_interstitials/content/ssl_cert_reporter.h" | ||
| 4216 | #include "components/security_interstitials/core/controller_client.h" | ||
| 4217 | #include "components/security_interstitials/core/metrics_helper.h" | ||
| 4218 | @@ -86,8 +85,7 @@ void CertReportHelper::PopulateExtendedR | ||
| 4219 | return; | ||
| 4220 | |||
| 4221 | load_time_data->SetBoolKey( | ||
| 4222 | - security_interstitials::kBoxChecked, | ||
| 4223 | - safe_browsing::IsExtendedReportingEnabled(*GetPrefs(web_contents_))); | ||
| 4224 | + security_interstitials::kBoxChecked, false); | ||
| 4225 | |||
| 4226 | load_time_data->SetStringKey( | ||
| 4227 | security_interstitials::kOptInLink, | ||
| 4228 | @@ -124,14 +122,8 @@ void CertReportHelper::HandleReportingCo | ||
| 4229 | PrefService* pref_service) { | ||
| 4230 | switch (command) { | ||
| 4231 | case security_interstitials::CMD_DO_REPORT: | ||
| 4232 | - safe_browsing::SetExtendedReportingPrefAndMetric( | ||
| 4233 | - pref_service, true, /* value */ | ||
| 4234 | - safe_browsing::SBER_OPTIN_SITE_SECURITY_INTERSTITIAL); | ||
| 4235 | break; | ||
| 4236 | case security_interstitials::CMD_DONT_REPORT: | ||
| 4237 | - safe_browsing::SetExtendedReportingPrefAndMetric( | ||
| 4238 | - pref_service, false, /* value */ | ||
| 4239 | - safe_browsing::SBER_OPTIN_SITE_SECURITY_INTERSTITIAL); | ||
| 4240 | break; | ||
| 4241 | case security_interstitials::CMD_PROCEED: | ||
| 4242 | user_action_ = CertificateErrorReport::USER_PROCEEDED; | ||
| 4243 | @@ -149,7 +141,7 @@ void CertReportHelper::FinishCertCollect | ||
| 4244 | if (!ShouldShowCertificateReporterCheckbox()) | ||
| 4245 | return; | ||
| 4246 | |||
| 4247 | - if (!safe_browsing::IsExtendedReportingEnabled(*GetPrefs(web_contents_))) | ||
| 4248 | + if (true) | ||
| 4249 | return; | ||
| 4250 | |||
| 4251 | if (metrics_helper_) { | ||
| 4252 | @@ -180,51 +172,11 @@ void CertReportHelper::FinishCertCollect | ||
| 4253 | } | ||
| 4254 | |||
| 4255 | bool CertReportHelper::ShouldShowCertificateReporterCheckbox() { | ||
| 4256 | - // Only show the checkbox iff the user is part of the respective Finch group | ||
| 4257 | - // and the window is not incognito and the feature is not disabled by policy | ||
| 4258 | - // and enhanced protection is off. | ||
| 4259 | - const bool in_incognito = | ||
| 4260 | - web_contents_->GetBrowserContext()->IsOffTheRecord(); | ||
| 4261 | - const PrefService* pref_service = GetPrefs(web_contents_); | ||
| 4262 | - bool can_show_checkbox = | ||
| 4263 | - safe_browsing::IsExtendedReportingOptInAllowed(*pref_service) && | ||
| 4264 | - !safe_browsing::IsExtendedReportingPolicyManaged(*pref_service); | ||
| 4265 | - bool is_enhanced_protection_enabled = | ||
| 4266 | - safe_browsing::IsEnhancedProtectionEnabled(*pref_service); | ||
| 4267 | - | ||
| 4268 | - return base::FieldTrialList::FindFullName(kFinchExperimentName) == | ||
| 4269 | - kFinchGroupShowPossiblySend && | ||
| 4270 | - !in_incognito && can_show_checkbox && !is_enhanced_protection_enabled; | ||
| 4271 | + return false; | ||
| 4272 | } | ||
| 4273 | |||
| 4274 | bool CertReportHelper::ShouldShowEnhancedProtectionMessage() { | ||
| 4275 | - // Only show the enhanced protection message if all the following are true: | ||
| 4276 | - // |can_show_enhanced_protection_message_| is set to true AND | ||
| 4277 | - // the window is not incognito AND | ||
| 4278 | - // Safe Browsing is not managed by policy AND | ||
| 4279 | - // the user is not already in enhanced protection mode. | ||
| 4280 | - if (!can_show_enhanced_protection_message_) { | ||
| 4281 | - return false; | ||
| 4282 | - } | ||
| 4283 | - | ||
| 4284 | - const bool in_incognito = | ||
| 4285 | - web_contents_->GetBrowserContext()->IsOffTheRecord(); | ||
| 4286 | - const PrefService* pref_service = GetPrefs(web_contents_); | ||
| 4287 | - bool is_enhanced_protection_enabled = | ||
| 4288 | - safe_browsing::IsEnhancedProtectionEnabled(*pref_service); | ||
| 4289 | - bool is_safe_browsing_managed = | ||
| 4290 | - safe_browsing::IsSafeBrowsingPolicyManaged(*pref_service); | ||
| 4291 | - | ||
| 4292 | - if (in_incognito) { | ||
| 4293 | - return false; | ||
| 4294 | - } | ||
| 4295 | - if (is_enhanced_protection_enabled) { | ||
| 4296 | - return false; | ||
| 4297 | - } | ||
| 4298 | - if (is_safe_browsing_managed) { | ||
| 4299 | - return false; | ||
| 4300 | - } | ||
| 4301 | - return true; | ||
| 4302 | + return false; | ||
| 4303 | } | ||
| 4304 | |||
| 4305 | bool CertReportHelper::ShouldReportCertificateError() { | ||
| 4306 | --- components/security_interstitials/content/mitm_software_blocking_page.cc.orig | ||
| 4307 | +++ components/security_interstitials/content/mitm_software_blocking_page.cc | ||
| 4308 | @@ -6,7 +6,6 @@ | ||
| 4309 | |||
| 4310 | #include <utility> | ||
| 4311 | |||
| 4312 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 4313 | #include "components/security_interstitials/content/cert_report_helper.h" | ||
| 4314 | #include "components/security_interstitials/content/security_interstitial_controller_client.h" | ||
| 4315 | #include "components/security_interstitials/content/security_interstitial_page.h" | ||
| 4316 | --- components/security_interstitials/content/security_interstitial_controller_client.cc.orig | ||
| 4317 | +++ components/security_interstitials/content/security_interstitial_controller_client.cc | ||
| 4318 | @@ -7,7 +7,6 @@ | ||
| 4319 | #include <utility> | ||
| 4320 | |||
| 4321 | #include "components/prefs/pref_service.h" | ||
| 4322 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 4323 | #include "components/security_interstitials/content/settings_page_helper.h" | ||
| 4324 | #include "components/security_interstitials/core/metrics_helper.h" | ||
| 4325 | #include "content/public/browser/web_contents.h" | ||
| 4326 | @@ -98,11 +97,6 @@ SecurityInterstitialControllerClient::Ge | ||
| 4327 | return prefs_; | ||
| 4328 | } | ||
| 4329 | |||
| 4330 | -const std::string | ||
| 4331 | -SecurityInterstitialControllerClient::GetExtendedReportingPrefName() const { | ||
| 4332 | - return prefs::kSafeBrowsingScoutReportingEnabled; | ||
| 4333 | -} | ||
| 4334 | - | ||
| 4335 | bool SecurityInterstitialControllerClient::CanLaunchDateAndTimeSettings() { | ||
| 4336 | NOTREACHED(); | ||
| 4337 | return false; | ||
| 4338 | --- components/security_interstitials/content/security_interstitial_controller_client.h.orig | ||
| 4339 | +++ components/security_interstitials/content/security_interstitial_controller_client.h | ||
| 4340 | @@ -54,8 +54,6 @@ class SecurityInterstitialControllerClie | ||
| 4341 | bool CanGoBackBeforeNavigation() override; | ||
| 4342 | |||
| 4343 | protected: | ||
| 4344 | - // security_interstitials::ControllerClient overrides. | ||
| 4345 | - const std::string GetExtendedReportingPrefName() const override; | ||
| 4346 | content::WebContents* web_contents_; | ||
| 4347 | |||
| 4348 | private: | ||
| 4349 | --- components/security_interstitials/content/security_interstitial_page.cc.orig | ||
| 4350 | +++ components/security_interstitials/content/security_interstitial_page.cc | ||
| 4351 | @@ -11,7 +11,6 @@ | ||
| 4352 | #include "base/values.h" | ||
| 4353 | #include "components/grit/components_resources.h" | ||
| 4354 | #include "components/prefs/pref_service.h" | ||
| 4355 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 4356 | #include "components/security_interstitials/content/security_interstitial_controller_client.h" | ||
| 4357 | #include "components/security_interstitials/core/common_string_util.h" | ||
| 4358 | #include "content/public/browser/page_navigator.h" | ||
| 4359 | @@ -32,13 +31,6 @@ SecurityInterstitialPage::SecurityInters | ||
| 4360 | on_show_extended_reporting_pref_exists_(false), | ||
| 4361 | on_show_extended_reporting_pref_value_(false), | ||
| 4362 | controller_(std::move(controller)) { | ||
| 4363 | - // Determine if any prefs need to be updated prior to showing the security | ||
| 4364 | - // interstitial. Note that some content embedders (such as Android WebView) | ||
| 4365 | - // uses security interstitials without a prefservice. | ||
| 4366 | - if (controller_->GetPrefService()) { | ||
| 4367 | - safe_browsing::UpdatePrefsBeforeSecurityInterstitial( | ||
| 4368 | - controller_->GetPrefService()); | ||
| 4369 | - } | ||
| 4370 | SetUpMetrics(); | ||
| 4371 | } | ||
| 4372 | |||
| 4373 | @@ -88,15 +80,8 @@ SecurityInterstitialControllerClient* Se | ||
| 4374 | } | ||
| 4375 | |||
| 4376 | void SecurityInterstitialPage::SetUpMetrics() { | ||
| 4377 | - // Remember the initial state of the extended reporting pref, to be compared | ||
| 4378 | - // to the same data when the interstitial is closed. | ||
| 4379 | - PrefService* prefs = controller_->GetPrefService(); | ||
| 4380 | - if (prefs) { | ||
| 4381 | - on_show_extended_reporting_pref_exists_ = | ||
| 4382 | - safe_browsing::ExtendedReportingPrefExists(*prefs); | ||
| 4383 | - on_show_extended_reporting_pref_value_ = | ||
| 4384 | - safe_browsing::IsExtendedReportingEnabled(*prefs); | ||
| 4385 | - } | ||
| 4386 | + on_show_extended_reporting_pref_exists_ = false; | ||
| 4387 | + on_show_extended_reporting_pref_value_ = false; | ||
| 4388 | } | ||
| 4389 | |||
| 4390 | std::u16string SecurityInterstitialPage::GetFormattedHostName() const { | ||
| 4391 | --- components/security_interstitials/content/ssl_blocking_page.cc.orig | ||
| 4392 | +++ components/security_interstitials/content/ssl_blocking_page.cc | ||
| 4393 | @@ -12,7 +12,6 @@ | ||
| 4394 | #include "base/metrics/histogram_macros.h" | ||
| 4395 | #include "base/strings/string_number_conversions.h" | ||
| 4396 | #include "base/time/time.h" | ||
| 4397 | -#include "components/safe_browsing/core/common/safe_browsing_prefs.h" | ||
| 4398 | #include "components/security_interstitials/content/cert_report_helper.h" | ||
| 4399 | #include "components/security_interstitials/content/security_interstitial_controller_client.h" | ||
| 4400 | #include "components/security_interstitials/content/security_interstitial_page.h" | ||
| 4401 | --- components/security_interstitials/core/controller_client.cc.orig | ||
| 4402 | +++ components/security_interstitials/core/controller_client.cc | ||
| 4403 | @@ -36,7 +36,6 @@ MetricsHelper* ControllerClient::metrics | ||
| 4404 | |||
| 4405 | void ControllerClient::SetReportingPreference(bool report) { | ||
| 4406 | DCHECK(GetPrefService()); | ||
| 4407 | - GetPrefService()->SetBoolean(GetExtendedReportingPrefName(), report); | ||
| 4408 | metrics_helper_->RecordUserInteraction( | ||
| 4409 | report ? MetricsHelper::SET_EXTENDED_REPORTING_ENABLED | ||
| 4410 | : MetricsHelper::SET_EXTENDED_REPORTING_DISABLED); | ||
| 4411 | --- components/security_interstitials/core/controller_client.h.orig | ||
| 4412 | +++ components/security_interstitials/core/controller_client.h | ||
| 4413 | @@ -122,9 +122,6 @@ class ControllerClient { | ||
| 4414 | |||
| 4415 | void SetBaseHelpCenterUrlForTesting(const GURL& test_url); | ||
| 4416 | |||
| 4417 | - protected: | ||
| 4418 | - virtual const std::string GetExtendedReportingPrefName() const = 0; | ||
| 4419 | - | ||
| 4420 | private: | ||
| 4421 | std::unique_ptr<MetricsHelper> metrics_helper_; | ||
| 4422 | // Link to the help center. | ||
| 4423 | --- components/signin/core/browser/account_investigator.cc.orig | ||
| 4424 | +++ components/signin/core/browser/account_investigator.cc | ||
| 4425 | @@ -13,7 +13,6 @@ | ||
| 4426 | #include "components/prefs/pref_registry_simple.h" | ||
| 4427 | #include "components/prefs/pref_service.h" | ||
| 4428 | #include "components/signin/public/base/signin_metrics.h" | ||
| 4429 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 4430 | #include "components/signin/public/identity_manager/accounts_in_cookie_jar_info.h" | ||
| 4431 | #include "google_apis/gaia/gaia_auth_util.h" | ||
| 4432 | #include "google_apis/gaia/google_service_auth_error.h" | ||
| 4433 | @@ -66,25 +65,12 @@ AccountInvestigator::~AccountInvestigato | ||
| 4434 | |||
| 4435 | // static | ||
| 4436 | void AccountInvestigator::RegisterPrefs(PrefRegistrySimple* registry) { | ||
| 4437 | - registry->RegisterStringPref(prefs::kGaiaCookieHash, std::string()); | ||
| 4438 | - registry->RegisterDoublePref(prefs::kGaiaCookieChangedTime, 0); | ||
| 4439 | - registry->RegisterDoublePref(prefs::kGaiaCookiePeriodicReportTime, 0); | ||
| 4440 | } | ||
| 4441 | |||
| 4442 | void AccountInvestigator::Initialize() { | ||
| 4443 | identity_manager_->AddObserver(this); | ||
| 4444 | previously_authenticated_ = | ||
| 4445 | identity_manager_->HasPrimaryAccount(signin::ConsentLevel::kSync); | ||
| 4446 | - | ||
| 4447 | - // TODO(crbug.com/1121923): Refactor to use signin::PersistentRepeatingTimer | ||
| 4448 | - // instead. | ||
| 4449 | - Time previous = Time::FromDoubleT( | ||
| 4450 | - pref_service_->GetDouble(prefs::kGaiaCookiePeriodicReportTime)); | ||
| 4451 | - if (previous.is_null()) | ||
| 4452 | - previous = Time::Now(); | ||
| 4453 | - const base::TimeDelta delay = | ||
| 4454 | - CalculatePeriodicDelay(previous, Time::Now(), kPeriodicReportingInterval); | ||
| 4455 | - timer_.Start(FROM_HERE, delay, this, &AccountInvestigator::TryPeriodicReport); | ||
| 4456 | } | ||
| 4457 | |||
| 4458 | void AccountInvestigator::Shutdown() { | ||
| 4459 | @@ -111,7 +97,7 @@ void AccountInvestigator::OnAccountsInCo | ||
| 4460 | // a valid cached ListAccounts response ready for us. Or even both of these | ||
| 4461 | // could be simultaneously happening, although this should be extremely | ||
| 4462 | // infrequent. | ||
| 4463 | - const std::string old_hash(pref_service_->GetString(prefs::kGaiaCookieHash)); | ||
| 4464 | + const std::string old_hash; | ||
| 4465 | const std::string new_hash( | ||
| 4466 | HashAccounts(signed_in_accounts, signed_out_accounts)); | ||
| 4467 | const bool currently_authenticated = | ||
| 4468 | @@ -119,9 +105,6 @@ void AccountInvestigator::OnAccountsInCo | ||
| 4469 | if (old_hash != new_hash) { | ||
| 4470 | SharedCookieJarReport(signed_in_accounts, signed_out_accounts, Time::Now(), | ||
| 4471 | ReportingType::ON_CHANGE); | ||
| 4472 | - pref_service_->SetString(prefs::kGaiaCookieHash, new_hash); | ||
| 4473 | - pref_service_->SetDouble(prefs::kGaiaCookieChangedTime, | ||
| 4474 | - Time::Now().ToDoubleT()); | ||
| 4475 | } else if (currently_authenticated && !previously_authenticated_) { | ||
| 4476 | SignedInAccountRelationReport(signed_in_accounts, signed_out_accounts, | ||
| 4477 | ReportingType::ON_CHANGE); | ||
| 4478 | @@ -247,10 +230,6 @@ void AccountInvestigator::DoPeriodicRepo | ||
| 4479 | } | ||
| 4480 | |||
| 4481 | periodic_pending_ = false; | ||
| 4482 | - pref_service_->SetDouble(prefs::kGaiaCookiePeriodicReportTime, | ||
| 4483 | - Time::Now().ToDoubleT()); | ||
| 4484 | - timer_.Start(FROM_HERE, kPeriodicReportingInterval, this, | ||
| 4485 | - &AccountInvestigator::TryPeriodicReport); | ||
| 4486 | } | ||
| 4487 | |||
| 4488 | void AccountInvestigator::SharedCookieJarReport( | ||
| 4489 | @@ -258,8 +237,7 @@ void AccountInvestigator::SharedCookieJa | ||
| 4490 | const std::vector<ListedAccount>& signed_out_accounts, | ||
| 4491 | const Time now, | ||
| 4492 | const ReportingType type) { | ||
| 4493 | - const Time last_changed = Time::FromDoubleT( | ||
| 4494 | - pref_service_->GetDouble(prefs::kGaiaCookieChangedTime)); | ||
| 4495 | + const Time last_changed = Time::Now(); | ||
| 4496 | base::TimeDelta stable_age; | ||
| 4497 | if (!last_changed.is_null()) | ||
| 4498 | stable_age = std::max(now - last_changed, base::TimeDelta()); | ||
| 4499 | --- components/signin/core/browser/account_investigator_unittest.cc.orig | ||
| 4500 | +++ components/signin/core/browser/account_investigator_unittest.cc | ||
| 4501 | @@ -12,7 +12,6 @@ | ||
| 4502 | #include "build/build_config.h" | ||
| 4503 | #include "components/prefs/pref_registry_simple.h" | ||
| 4504 | #include "components/signin/public/base/signin_metrics.h" | ||
| 4505 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 4506 | #include "components/signin/public/identity_manager/accounts_in_cookie_jar_info.h" | ||
| 4507 | #include "components/signin/public/identity_manager/identity_test_environment.h" | ||
| 4508 | #include "components/sync_preferences/testing_pref_service_syncable.h" | ||
| 4509 | --- components/signin/core/browser/account_reconcilor_unittest.cc.orig | ||
| 4510 | +++ components/signin/core/browser/account_reconcilor_unittest.cc | ||
| 4511 | @@ -29,7 +29,6 @@ | ||
| 4512 | #include "components/signin/public/base/list_accounts_test_utils.h" | ||
| 4513 | #include "components/signin/public/base/signin_buildflags.h" | ||
| 4514 | #include "components/signin/public/base/signin_metrics.h" | ||
| 4515 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 4516 | #include "components/signin/public/base/test_signin_client.h" | ||
| 4517 | #include "components/signin/public/identity_manager/accounts_in_cookie_jar_info.h" | ||
| 4518 | #include "components/signin/public/identity_manager/identity_test_environment.h" | ||
| 4519 | --- components/signin/core/browser/dice_account_reconcilor_delegate.cc.orig | ||
| 4520 | +++ components/signin/core/browser/dice_account_reconcilor_delegate.cc | ||
| 4521 | @@ -12,7 +12,6 @@ | ||
| 4522 | #include "base/ranges/algorithm.h" | ||
| 4523 | #include "components/prefs/pref_service.h" | ||
| 4524 | #include "components/signin/public/base/signin_client.h" | ||
| 4525 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 4526 | |||
| 4527 | namespace signin { | ||
| 4528 | |||
| 4529 | --- components/signin/core/browser/dice_account_reconcilor_delegate_unittest.cc.orig | ||
| 4530 | +++ components/signin/core/browser/dice_account_reconcilor_delegate_unittest.cc | ||
| 4531 | @@ -8,7 +8,6 @@ | ||
| 4532 | |||
| 4533 | #include "components/prefs/pref_registry_simple.h" | ||
| 4534 | #include "components/signin/public/base/account_consistency_method.h" | ||
| 4535 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 4536 | #include "components/signin/public/base/test_signin_client.h" | ||
| 4537 | #include "components/sync_preferences/testing_pref_service_syncable.h" | ||
| 4538 | #include "google_apis/gaia/gaia_auth_util.h" | ||
| 4539 | --- components/signin/core/browser/signin_investigator.cc.orig | ||
| 4540 | +++ components/signin/core/browser/signin_investigator.cc | ||
| 4541 | @@ -7,7 +7,6 @@ | ||
| 4542 | #include "base/check.h" | ||
| 4543 | #include "base/metrics/histogram_macros.h" | ||
| 4544 | #include "components/signin/public/base/signin_metrics.h" | ||
| 4545 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 4546 | #include "google_apis/gaia/gaia_auth_util.h" | ||
| 4547 | |||
| 4548 | using signin_metrics::AccountEquality; | ||
| 4549 | @@ -26,13 +25,9 @@ SigninInvestigator::SigninInvestigator(c | ||
| 4550 | SigninInvestigator::~SigninInvestigator() {} | ||
| 4551 | |||
| 4552 | bool SigninInvestigator::AreAccountsEqualWithFallback() { | ||
| 4553 | - const std::string last_id = | ||
| 4554 | - provider_->GetPrefs()->GetString(prefs::kGoogleServicesLastAccountId); | ||
| 4555 | - bool same_email = gaia::AreEmailsSame( | ||
| 4556 | - current_email_, | ||
| 4557 | - provider_->GetPrefs()->GetString(prefs::kGoogleServicesLastUsername)); | ||
| 4558 | - if (!current_id_.empty() && !last_id.empty()) { | ||
| 4559 | - bool same_id = current_id_ == last_id; | ||
| 4560 | + bool same_email = false; | ||
| 4561 | + if (false) { | ||
| 4562 | + bool same_id = false; | ||
| 4563 | if (same_email && same_id) { | ||
| 4564 | LogAccountEquality(AccountEquality::BOTH_EQUAL); | ||
| 4565 | } else if (same_email) { | ||
| 4566 | @@ -51,9 +46,7 @@ bool SigninInvestigator::AreAccountsEqua | ||
| 4567 | |||
| 4568 | InvestigatedScenario SigninInvestigator::Investigate() { | ||
| 4569 | InvestigatedScenario scenario; | ||
| 4570 | - if (provider_->GetPrefs() | ||
| 4571 | - ->GetString(prefs::kGoogleServicesLastUsername) | ||
| 4572 | - .empty()) { | ||
| 4573 | + if (true) { | ||
| 4574 | scenario = InvestigatedScenario::kFirstSignIn; | ||
| 4575 | } else if (AreAccountsEqualWithFallback()) { | ||
| 4576 | scenario = InvestigatedScenario::kSameAccount; | ||
| 4577 | --- components/signin/core/browser/signin_investigator_unittest.cc.orig | ||
| 4578 | +++ components/signin/core/browser/signin_investigator_unittest.cc | ||
| 4579 | @@ -9,7 +9,6 @@ | ||
| 4580 | #include "components/prefs/pref_registry_simple.h" | ||
| 4581 | #include "components/signin/core/browser/signin_investigator.h" | ||
| 4582 | #include "components/signin/public/base/signin_metrics.h" | ||
| 4583 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 4584 | #include "components/signin/public/identity_manager/identity_test_environment.h" | ||
| 4585 | #include "components/sync_preferences/testing_pref_service_syncable.h" | ||
| 4586 | #include "testing/gtest/include/gtest/gtest.h" | ||
| 4587 | --- components/signin/internal/identity_manager/account_tracker_service.cc.orig | ||
| 4588 | +++ components/signin/internal/identity_manager/account_tracker_service.cc | ||
| 4589 | @@ -29,7 +29,6 @@ | ||
| 4590 | #include "components/prefs/scoped_user_pref_update.h" | ||
| 4591 | #include "components/signin/internal/identity_manager/account_capabilities_constants.h" | ||
| 4592 | #include "components/signin/internal/identity_manager/account_info_util.h" | ||
| 4593 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 4594 | #include "components/signin/public/base/signin_switches.h" | ||
| 4595 | #include "components/signin/public/identity_manager/account_capabilities.h" | ||
| 4596 | #include "components/signin/public/identity_manager/tribool.h" | ||
| 4597 | @@ -152,9 +151,6 @@ AccountTrackerService::~AccountTrackerSe | ||
| 4598 | |||
| 4599 | // static | ||
| 4600 | void AccountTrackerService::RegisterPrefs(PrefRegistrySimple* registry) { | ||
| 4601 | - registry->RegisterListPref(prefs::kAccountInfo); | ||
| 4602 | - registry->RegisterIntegerPref(prefs::kAccountIdMigrationState, | ||
| 4603 | - AccountTrackerService::MIGRATION_NOT_STARTED); | ||
| 4604 | } | ||
| 4605 | |||
| 4606 | void AccountTrackerService::Initialize(PrefService* pref_service, | ||
| 4607 | @@ -455,14 +451,12 @@ AccountTrackerService::ComputeNewMigrati | ||
| 4608 | |||
| 4609 | void AccountTrackerService::SetMigrationState(AccountIdMigrationState state) { | ||
| 4610 | DCHECK(state != MIGRATION_DONE || AreAllAccountsMigrated()); | ||
| 4611 | - pref_service_->SetInteger(prefs::kAccountIdMigrationState, state); | ||
| 4612 | } | ||
| 4613 | |||
| 4614 | // static | ||
| 4615 | AccountTrackerService::AccountIdMigrationState | ||
| 4616 | AccountTrackerService::GetMigrationState(const PrefService* pref_service) { | ||
| 4617 | - return static_cast<AccountTrackerService::AccountIdMigrationState>( | ||
| 4618 | - pref_service->GetInteger(prefs::kAccountIdMigrationState)); | ||
| 4619 | + return MIGRATION_NOT_STARTED; | ||
| 4620 | } | ||
| 4621 | |||
| 4622 | base::FilePath AccountTrackerService::GetImagePathFor( | ||
| 4623 | @@ -519,24 +513,7 @@ void AccountTrackerService::OnAccountIma | ||
| 4624 | const CoreAccountId& account_id, | ||
| 4625 | const std::string& image_url_with_size, | ||
| 4626 | bool success) { | ||
| 4627 | - if (!success || !pref_service_) | ||
| 4628 | - return; | ||
| 4629 | - | ||
| 4630 | - base::DictionaryValue* dict = nullptr; | ||
| 4631 | - ListPrefUpdate update(pref_service_, prefs::kAccountInfo); | ||
| 4632 | - for (size_t i = 0; i < update->GetList().size(); ++i, dict = nullptr) { | ||
| 4633 | - if (update->GetDictionary(i, &dict)) { | ||
| 4634 | - std::string value; | ||
| 4635 | - if (dict->GetString(kAccountKeyPath, &value) && | ||
| 4636 | - value == account_id.ToString()) | ||
| 4637 | - break; | ||
| 4638 | - } | ||
| 4639 | - } | ||
| 4640 | - | ||
| 4641 | - if (!dict) { | ||
| 4642 | - return; | ||
| 4643 | - } | ||
| 4644 | - dict->SetString(kLastDownloadedImageURLWithSizePath, image_url_with_size); | ||
| 4645 | + return; | ||
| 4646 | } | ||
| 4647 | |||
| 4648 | void AccountTrackerService::RemoveAccountImageFromDisk( | ||
| 4649 | @@ -548,11 +525,10 @@ void AccountTrackerService::RemoveAccoun | ||
| 4650 | } | ||
| 4651 | |||
| 4652 | void AccountTrackerService::LoadFromPrefs() { | ||
| 4653 | - const base::ListValue* list = pref_service_->GetList(prefs::kAccountInfo); | ||
| 4654 | std::set<CoreAccountId> to_remove; | ||
| 4655 | - for (size_t i = 0; i < list->GetList().size(); ++i) { | ||
| 4656 | + for (size_t i = 0; false; ++i) { | ||
| 4657 | const base::DictionaryValue* dict = nullptr; | ||
| 4658 | - if (list->GetDictionary(i, &dict)) { | ||
| 4659 | + if (false) { | ||
| 4660 | std::string value; | ||
| 4661 | if (dict->GetString(kAccountKeyPath, &value)) { | ||
| 4662 | // Ignore incorrectly persisted non-canonical account ids. | ||
| 4663 | @@ -588,14 +564,6 @@ void AccountTrackerService::LoadFromPref | ||
| 4664 | account_info.is_child_account = is_child_status.value() | ||
| 4665 | ? signin::Tribool::kTrue | ||
| 4666 | : signin::Tribool::kFalse; | ||
| 4667 | - // Migrate to kAccountChildAttributePath. | ||
| 4668 | - ListPrefUpdate update(pref_service_, prefs::kAccountInfo); | ||
| 4669 | - base::DictionaryValue* update_dict = nullptr; | ||
| 4670 | - update->GetDictionary(i, &update_dict); | ||
| 4671 | - DCHECK(update_dict); | ||
| 4672 | - SetAccountCapabilityPath(update_dict, kAccountChildAttributePath, | ||
| 4673 | - account_info.is_child_account); | ||
| 4674 | - update_dict->RemoveKey(kDeprecatedChildStatusPath); | ||
| 4675 | } else { | ||
| 4676 | account_info.is_child_account = | ||
| 4677 | FindAccountCapabilityPath(*dict, kAccountChildAttributePath); | ||
| 4678 | @@ -654,13 +622,11 @@ void AccountTrackerService::LoadFromPref | ||
| 4679 | } | ||
| 4680 | |||
| 4681 | void AccountTrackerService::SaveToPrefs(const AccountInfo& account_info) { | ||
| 4682 | - if (!pref_service_) | ||
| 4683 | - return; | ||
| 4684 | + return; | ||
| 4685 | |||
| 4686 | base::DictionaryValue* dict = nullptr; | ||
| 4687 | - ListPrefUpdate update(pref_service_, prefs::kAccountInfo); | ||
| 4688 | - for (size_t i = 0; i < update->GetList().size(); ++i, dict = nullptr) { | ||
| 4689 | - if (update->GetDictionary(i, &dict)) { | ||
| 4690 | + if (false) { | ||
| 4691 | + while (false) { | ||
| 4692 | std::string value; | ||
| 4693 | if (dict->GetString(kAccountKeyPath, &value) && | ||
| 4694 | value == account_info.account_id.ToString()) | ||
| 4695 | @@ -670,9 +636,6 @@ void AccountTrackerService::SaveToPrefs( | ||
| 4696 | |||
| 4697 | if (!dict) { | ||
| 4698 | dict = new base::DictionaryValue(); | ||
| 4699 | - update->Append(base::WrapUnique(dict)); | ||
| 4700 | - // |dict| is invalidated at this point, so it needs to be reset. | ||
| 4701 | - update->GetDictionary(update->GetList().size() - 1, &dict); | ||
| 4702 | dict->SetString(kAccountKeyPath, account_info.account_id.ToString()); | ||
| 4703 | } | ||
| 4704 | |||
| 4705 | @@ -699,14 +662,7 @@ void AccountTrackerService::RemoveFromPr | ||
| 4706 | if (!pref_service_) | ||
| 4707 | return; | ||
| 4708 | |||
| 4709 | - ListPrefUpdate update(pref_service_, prefs::kAccountInfo); | ||
| 4710 | const std::string account_id = account_info.account_id.ToString(); | ||
| 4711 | - update->EraseListValueIf([&account_id](const base::Value& value) { | ||
| 4712 | - if (!value.is_dict()) | ||
| 4713 | - return false; | ||
| 4714 | - const std::string* account_key = value.FindStringKey(kAccountKeyPath); | ||
| 4715 | - return account_key && *account_key == account_id; | ||
| 4716 | - }); | ||
| 4717 | } | ||
| 4718 | |||
| 4719 | CoreAccountId AccountTrackerService::PickAccountIdForAccount( | ||
| 4720 | --- components/signin/internal/identity_manager/account_tracker_service.h.orig | ||
| 4721 | +++ components/signin/internal/identity_manager/account_tracker_service.h | ||
| 4722 | @@ -236,6 +236,8 @@ class AccountTrackerService { | ||
| 4723 | AccountInfoCallback on_account_updated_callback_; | ||
| 4724 | AccountInfoCallback on_account_removed_callback_; | ||
| 4725 | |||
| 4726 | + AccountIdMigrationState migration_state_; | ||
| 4727 | + | ||
| 4728 | // Task runner used for file operations on avatar images. | ||
| 4729 | scoped_refptr<base::SequencedTaskRunner> image_storage_task_runner_; | ||
| 4730 | |||
| 4731 | --- components/signin/internal/identity_manager/account_tracker_service_unittest.cc.orig | ||
| 4732 | +++ components/signin/internal/identity_manager/account_tracker_service_unittest.cc | ||
| 4733 | @@ -26,7 +26,6 @@ | ||
| 4734 | #include "components/signin/internal/identity_manager/account_tracker_service.h" | ||
| 4735 | #include "components/signin/internal/identity_manager/fake_profile_oauth2_token_service.h" | ||
| 4736 | #include "components/signin/public/base/avatar_icon_util.h" | ||
| 4737 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 4738 | #include "components/signin/public/base/signin_switches.h" | ||
| 4739 | #include "components/signin/public/base/test_signin_client.h" | ||
| 4740 | #include "components/signin/public/identity_manager/account_capabilities.h" | ||
| 4741 | --- components/signin/internal/identity_manager/gaia_cookie_manager_service.cc.orig | ||
| 4742 | +++ components/signin/internal/identity_manager/gaia_cookie_manager_service.cc | ||
| 4743 | @@ -29,7 +29,6 @@ | ||
| 4744 | #include "components/signin/internal/identity_manager/ubertoken_fetcher_impl.h" | ||
| 4745 | #include "components/signin/public/base/signin_buildflags.h" | ||
| 4746 | #include "components/signin/public/base/signin_metrics.h" | ||
| 4747 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 4748 | #include "components/signin/public/identity_manager/set_accounts_in_cookie_result.h" | ||
| 4749 | #include "google_apis/gaia/gaia_constants.h" | ||
| 4750 | #include "google_apis/gaia/gaia_urls.h" | ||
| 4751 | @@ -456,9 +455,7 @@ GaiaCookieManagerService::GaiaCookieMana | ||
| 4752 | listAccountsUnexpectedServerResponseRetried_(false), | ||
| 4753 | external_cc_result_fetched_(false), | ||
| 4754 | list_accounts_stale_(true) { | ||
| 4755 | - std::string gaia_cookie_last_list_accounts_data = | ||
| 4756 | - signin_client_->GetPrefs()->GetString( | ||
| 4757 | - prefs::kGaiaCookieLastListAccountsData); | ||
| 4758 | + std::string gaia_cookie_last_list_accounts_data; | ||
| 4759 | |||
| 4760 | if (!gaia_cookie_last_list_accounts_data.empty()) { | ||
| 4761 | if (!gaia::ParseListAccountsData(gaia_cookie_last_list_accounts_data, | ||
| 4762 | @@ -482,8 +479,6 @@ GaiaCookieManagerService::~GaiaCookieMan | ||
| 4763 | |||
| 4764 | // static | ||
| 4765 | void GaiaCookieManagerService::RegisterPrefs(PrefRegistrySimple* registry) { | ||
| 4766 | - registry->RegisterStringPref(prefs::kGaiaCookieLastListAccountsData, | ||
| 4767 | - std::string()); | ||
| 4768 | } | ||
| 4769 | |||
| 4770 | void GaiaCookieManagerService::InitCookieListener() { | ||
| 4771 | @@ -906,16 +901,12 @@ void GaiaCookieManagerService::OnListAcc | ||
| 4772 | &signed_out_accounts_)) { | ||
| 4773 | listed_accounts_.clear(); | ||
| 4774 | signed_out_accounts_.clear(); | ||
| 4775 | - signin_client_->GetPrefs()->ClearPref( | ||
| 4776 | - prefs::kGaiaCookieLastListAccountsData); | ||
| 4777 | GoogleServiceAuthError error( | ||
| 4778 | GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE); | ||
| 4779 | OnListAccountsFailure(error); | ||
| 4780 | return; | ||
| 4781 | } | ||
| 4782 | |||
| 4783 | - signin_client_->GetPrefs()->SetString(prefs::kGaiaCookieLastListAccountsData, | ||
| 4784 | - data); | ||
| 4785 | RecordListAccountsFailure(GoogleServiceAuthError::NONE); | ||
| 4786 | |||
| 4787 | InitializeListedAccountsIds(); | ||
| 4788 | --- components/signin/internal/identity_manager/gaia_cookie_manager_service_unittest.cc.orig | ||
| 4789 | +++ components/signin/internal/identity_manager/gaia_cookie_manager_service_unittest.cc | ||
| 4790 | @@ -25,7 +25,6 @@ | ||
| 4791 | #include "components/prefs/testing_pref_service.h" | ||
| 4792 | #include "components/signin/internal/identity_manager/account_tracker_service.h" | ||
| 4793 | #include "components/signin/internal/identity_manager/fake_profile_oauth2_token_service.h" | ||
| 4794 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 4795 | #include "components/signin/public/base/test_signin_client.h" | ||
| 4796 | #include "google_apis/gaia/gaia_constants.h" | ||
| 4797 | #include "google_apis/gaia/gaia_urls.h" | ||
| 4798 | --- components/signin/internal/identity_manager/mutable_profile_oauth2_token_service_delegate.cc.orig | ||
| 4799 | +++ components/signin/internal/identity_manager/mutable_profile_oauth2_token_service_delegate.cc | ||
| 4800 | @@ -17,7 +17,6 @@ | ||
| 4801 | #include "components/prefs/pref_service.h" | ||
| 4802 | #include "components/signin/public/base/signin_client.h" | ||
| 4803 | #include "components/signin/public/base/signin_metrics.h" | ||
| 4804 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 4805 | #include "components/signin/public/identity_manager/account_info.h" | ||
| 4806 | #include "components/signin/public/webdata/token_web_data.h" | ||
| 4807 | #include "components/webdata/common/web_data_service_base.h" | ||
| 4808 | @@ -94,7 +93,7 @@ signin::LoadCredentialsState LoadCredent | ||
| 4809 | bool ShouldMigrateToDice(signin::AccountConsistencyMethod account_consistency, | ||
| 4810 | PrefService* prefs) { | ||
| 4811 | return account_consistency == signin::AccountConsistencyMethod::kDice && | ||
| 4812 | - !prefs->GetBoolean(prefs::kTokenServiceDiceCompatible); | ||
| 4813 | + true; | ||
| 4814 | } | ||
| 4815 | |||
| 4816 | } // namespace | ||
| 4817 | @@ -243,7 +242,6 @@ MutableProfileOAuth2TokenServiceDelegate | ||
| 4818 | // static | ||
| 4819 | void MutableProfileOAuth2TokenServiceDelegate::RegisterProfilePrefs( | ||
| 4820 | PrefRegistrySimple* registry) { | ||
| 4821 | - registry->RegisterBooleanPref(prefs::kTokenServiceDiceCompatible, false); | ||
| 4822 | } | ||
| 4823 | |||
| 4824 | std::unique_ptr<OAuth2AccessTokenFetcher> | ||
| 4825 | @@ -602,9 +600,6 @@ void MutableProfileOAuth2TokenServiceDel | ||
| 4826 | UpdateCredentials(loading_primary_account_id_, old_login_token); | ||
| 4827 | } | ||
| 4828 | } | ||
| 4829 | - | ||
| 4830 | - if (migrate_to_dice) | ||
| 4831 | - client_->GetPrefs()->SetBoolean(prefs::kTokenServiceDiceCompatible, true); | ||
| 4832 | } | ||
| 4833 | |||
| 4834 | void MutableProfileOAuth2TokenServiceDelegate::UpdateCredentials( | ||
| 4835 | @@ -795,8 +790,6 @@ void MutableProfileOAuth2TokenServiceDel | ||
| 4836 | } | ||
| 4837 | |||
| 4838 | void MutableProfileOAuth2TokenServiceDelegate::FinishLoadingCredentials() { | ||
| 4839 | - if (account_consistency_ == signin::AccountConsistencyMethod::kDice) | ||
| 4840 | - DCHECK(client_->GetPrefs()->GetBoolean(prefs::kTokenServiceDiceCompatible)); | ||
| 4841 | FireRefreshTokensLoaded(); | ||
| 4842 | } | ||
| 4843 | |||
| 4844 | @@ -827,8 +820,7 @@ void MutableProfileOAuth2TokenServiceDel | ||
| 4845 | LOAD_CREDENTIALS_FINISHED_WITH_DB_CANNOT_BE_OPENED); | ||
| 4846 | |||
| 4847 | if (account_consistency_ == signin::AccountConsistencyMethod::kDice && | ||
| 4848 | - !client_->GetPrefs()->GetBoolean(prefs::kTokenServiceDiceCompatible)) { | ||
| 4849 | + true) { | ||
| 4850 | RevokeAllCredentials(); | ||
| 4851 | - client_->GetPrefs()->SetBoolean(prefs::kTokenServiceDiceCompatible, true); | ||
| 4852 | } | ||
| 4853 | } | ||
| 4854 | --- components/signin/internal/identity_manager/mutable_profile_oauth2_token_service_delegate_unittest.cc.orig | ||
| 4855 | +++ components/signin/internal/identity_manager/mutable_profile_oauth2_token_service_delegate_unittest.cc | ||
| 4856 | @@ -25,7 +25,6 @@ | ||
| 4857 | #include "components/signin/internal/identity_manager/profile_oauth2_token_service.h" | ||
| 4858 | #include "components/signin/public/base/account_consistency_method.h" | ||
| 4859 | #include "components/signin/public/base/device_id_helper.h" | ||
| 4860 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 4861 | #include "components/signin/public/base/test_signin_client.h" | ||
| 4862 | #include "components/signin/public/identity_manager/account_info.h" | ||
| 4863 | #include "components/signin/public/webdata/token_web_data.h" | ||
| 4864 | --- components/signin/internal/identity_manager/primary_account_manager.cc.orig | ||
| 4865 | +++ components/signin/internal/identity_manager/primary_account_manager.cc | ||
| 4866 | @@ -22,7 +22,6 @@ | ||
| 4867 | #include "components/signin/public/base/account_consistency_method.h" | ||
| 4868 | #include "components/signin/public/base/signin_client.h" | ||
| 4869 | #include "components/signin/public/base/signin_metrics.h" | ||
| 4870 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 4871 | #include "components/signin/public/base/signin_switches.h" | ||
| 4872 | |||
| 4873 | using signin::PrimaryAccountChangeEvent; | ||
| 4874 | @@ -47,22 +46,10 @@ PrimaryAccountManager::~PrimaryAccountMa | ||
| 4875 | |||
| 4876 | // static | ||
| 4877 | void PrimaryAccountManager::RegisterProfilePrefs(PrefRegistrySimple* registry) { | ||
| 4878 | - registry->RegisterStringPref(prefs::kGoogleServicesLastAccountId, | ||
| 4879 | - std::string()); | ||
| 4880 | - registry->RegisterStringPref(prefs::kGoogleServicesLastUsername, | ||
| 4881 | - std::string()); | ||
| 4882 | - registry->RegisterStringPref(prefs::kGoogleServicesAccountId, std::string()); | ||
| 4883 | - registry->RegisterBooleanPref(prefs::kGoogleServicesConsentedToSync, false); | ||
| 4884 | - registry->RegisterBooleanPref(prefs::kAutologinEnabled, true); | ||
| 4885 | - registry->RegisterListPref(prefs::kReverseAutologinRejectedEmailList); | ||
| 4886 | - registry->RegisterBooleanPref(prefs::kSigninAllowed, true); | ||
| 4887 | - registry->RegisterBooleanPref(prefs::kSignedInWithCredentialProvider, false); | ||
| 4888 | } | ||
| 4889 | |||
| 4890 | // static | ||
| 4891 | void PrimaryAccountManager::RegisterPrefs(PrefRegistrySimple* registry) { | ||
| 4892 | - registry->RegisterStringPref(prefs::kGoogleServicesUsernamePattern, | ||
| 4893 | - std::string()); | ||
| 4894 | } | ||
| 4895 | |||
| 4896 | void PrimaryAccountManager::Initialize(PrefService* local_state) { | ||
| 4897 | @@ -70,25 +57,7 @@ void PrimaryAccountManager::Initialize(P | ||
| 4898 | DCHECK(!IsInitialized()); | ||
| 4899 | initialized_ = true; | ||
| 4900 | |||
| 4901 | - // If the user is clearing the token service from the command line, then | ||
| 4902 | - // clear their login info also (not valid to be logged in without any | ||
| 4903 | - // tokens). | ||
| 4904 | - base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); | ||
| 4905 | - if (cmd_line->HasSwitch(switches::kClearTokenService)) | ||
| 4906 | - SetPrimaryAccountInternal(CoreAccountInfo(), false); | ||
| 4907 | - | ||
| 4908 | - std::string pref_account_id = | ||
| 4909 | - client_->GetPrefs()->GetString(prefs::kGoogleServicesAccountId); | ||
| 4910 | - | ||
| 4911 | - // Initial value for the kGoogleServicesConsentedToSync preference if it is | ||
| 4912 | - // missing. | ||
| 4913 | - const PrefService::Preference* consented_pref = | ||
| 4914 | - client_->GetPrefs()->FindPreference( | ||
| 4915 | - prefs::kGoogleServicesConsentedToSync); | ||
| 4916 | - if (consented_pref->IsDefaultValue()) { | ||
| 4917 | - client_->GetPrefs()->SetBoolean(prefs::kGoogleServicesConsentedToSync, | ||
| 4918 | - !pref_account_id.empty()); | ||
| 4919 | - } | ||
| 4920 | + std::string pref_account_id; | ||
| 4921 | |||
| 4922 | if (!pref_account_id.empty()) { | ||
| 4923 | if (account_tracker_service_->GetMigrationState() == | ||
| 4924 | @@ -98,14 +67,11 @@ void PrimaryAccountManager::Initialize(P | ||
| 4925 | // |account_info.gaia| could be empty if |account_id| is already gaia id. | ||
| 4926 | if (!account_info.gaia.empty()) { | ||
| 4927 | pref_account_id = account_info.gaia; | ||
| 4928 | - client_->GetPrefs()->SetString(prefs::kGoogleServicesAccountId, | ||
| 4929 | - account_info.gaia); | ||
| 4930 | } | ||
| 4931 | } | ||
| 4932 | } | ||
| 4933 | |||
| 4934 | - bool consented = | ||
| 4935 | - client_->GetPrefs()->GetBoolean(prefs::kGoogleServicesConsentedToSync); | ||
| 4936 | + bool consented = false; | ||
| 4937 | CoreAccountId account_id = CoreAccountId::FromString(pref_account_id); | ||
| 4938 | CoreAccountInfo account_info = | ||
| 4939 | account_tracker_service_->GetAccountInfo(account_id); | ||
| 4940 | @@ -166,8 +132,7 @@ void PrimaryAccountManager::SetSyncPrima | ||
| 4941 | |||
| 4942 | #if DCHECK_IS_ON() | ||
| 4943 | { | ||
| 4944 | - std::string pref_account_id = | ||
| 4945 | - client_->GetPrefs()->GetString(prefs::kGoogleServicesAccountId); | ||
| 4946 | + std::string pref_account_id; | ||
| 4947 | bool consented_to_sync = | ||
| 4948 | client_->GetPrefs()->GetBoolean(prefs::kGoogleServicesConsentedToSync); | ||
| 4949 | |||
| 4950 | @@ -183,10 +148,6 @@ void PrimaryAccountManager::SetSyncPrima | ||
| 4951 | // Go ahead and update the last signed in account info here as well. Once a | ||
| 4952 | // user is signed in the corresponding preferences should match. Doing it here | ||
| 4953 | // as opposed to on signin allows us to catch the upgrade scenario. | ||
| 4954 | - client_->GetPrefs()->SetString(prefs::kGoogleServicesLastAccountId, | ||
| 4955 | - account_info.account_id.ToString()); | ||
| 4956 | - client_->GetPrefs()->SetString(prefs::kGoogleServicesLastUsername, | ||
| 4957 | - account_info.email); | ||
| 4958 | |||
| 4959 | // Commit primary sync account info immediately so that it does not get lost | ||
| 4960 | // if Chrome crashes before the next commit interval. | ||
| 4961 | @@ -200,20 +161,11 @@ void PrimaryAccountManager::SetPrimaryAc | ||
| 4962 | |||
| 4963 | PrefService* prefs = client_->GetPrefs(); | ||
| 4964 | const std::string& account_id = primary_account_info_.account_id.ToString(); | ||
| 4965 | - if (account_id.empty()) { | ||
| 4966 | - DCHECK(!consented_to_sync); | ||
| 4967 | - prefs->ClearPref(prefs::kGoogleServicesAccountId); | ||
| 4968 | - prefs->ClearPref(prefs::kGoogleServicesConsentedToSync); | ||
| 4969 | - } else { | ||
| 4970 | - prefs->SetString(prefs::kGoogleServicesAccountId, account_id); | ||
| 4971 | - prefs->SetBoolean(prefs::kGoogleServicesConsentedToSync, consented_to_sync); | ||
| 4972 | - } | ||
| 4973 | } | ||
| 4974 | |||
| 4975 | bool PrimaryAccountManager::HasPrimaryAccount( | ||
| 4976 | signin::ConsentLevel consent_level) const { | ||
| 4977 | - bool consented_pref = | ||
| 4978 | - client_->GetPrefs()->GetBoolean(prefs::kGoogleServicesConsentedToSync); | ||
| 4979 | + bool consented_pref = false; | ||
| 4980 | if (primary_account_info().account_id.empty()) { | ||
| 4981 | DCHECK(!consented_pref); | ||
| 4982 | return false; | ||
| 4983 | --- components/signin/internal/identity_manager/primary_account_manager_unittest.cc.orig | ||
| 4984 | +++ components/signin/internal/identity_manager/primary_account_manager_unittest.cc | ||
| 4985 | @@ -24,7 +24,6 @@ | ||
| 4986 | #include "components/signin/internal/identity_manager/fake_profile_oauth2_token_service_delegate.h" | ||
| 4987 | #include "components/signin/internal/identity_manager/primary_account_policy_manager.h" | ||
| 4988 | #include "components/signin/internal/identity_manager/profile_oauth2_token_service.h" | ||
| 4989 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 4990 | #include "components/signin/public/base/signin_switches.h" | ||
| 4991 | #include "components/signin/public/base/test_signin_client.h" | ||
| 4992 | #include "components/sync_preferences/testing_pref_service_syncable.h" | ||
| 4993 | --- components/signin/internal/identity_manager/primary_account_mutator_impl.cc.orig | ||
| 4994 | +++ components/signin/internal/identity_manager/primary_account_mutator_impl.cc | ||
| 4995 | @@ -14,7 +14,6 @@ | ||
| 4996 | #include "components/signin/internal/identity_manager/profile_oauth2_token_service.h" | ||
| 4997 | #include "components/signin/public/base/signin_buildflags.h" | ||
| 4998 | #include "components/signin/public/base/signin_metrics.h" | ||
| 4999 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 5000 | #include "google_apis/gaia/core_account_id.h" | ||
| 5001 | |||
| 5002 | namespace signin { | ||
| 5003 | @@ -58,7 +57,7 @@ PrimaryAccountMutatorImpl::SetPrimaryAcc | ||
| 5004 | DCHECK(!account_info.gaia.empty()); | ||
| 5005 | |||
| 5006 | #if !BUILDFLAG(IS_CHROMEOS_ASH) | ||
| 5007 | - bool is_signin_allowed = pref_service_->GetBoolean(prefs::kSigninAllowed); | ||
| 5008 | + bool is_signin_allowed = false; | ||
| 5009 | #if BUILDFLAG(IS_CHROMEOS_LACROS) | ||
| 5010 | // Check that `prefs::kSigninAllowed` has not been set to false in a context | ||
| 5011 | // where Lacros wants to set a Primary Account. Lacros doesn't offer account | ||
| 5012 | --- components/signin/internal/identity_manager/primary_account_policy_manager_impl.cc.orig | ||
| 5013 | +++ components/signin/internal/identity_manager/primary_account_policy_manager_impl.cc | ||
| 5014 | @@ -10,7 +10,6 @@ | ||
| 5015 | #include "components/signin/internal/identity_manager/primary_account_manager.h" | ||
| 5016 | #include "components/signin/public/base/signin_client.h" | ||
| 5017 | #include "components/signin/public/base/signin_metrics.h" | ||
| 5018 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 5019 | #include "components/signin/public/identity_manager/account_info.h" | ||
| 5020 | #include "components/signin/public/identity_manager/identity_utils.h" | ||
| 5021 | |||
| 5022 | @@ -28,18 +27,7 @@ void PrimaryAccountPolicyManagerImpl::In | ||
| 5023 | // local_state can be null during unit tests. | ||
| 5024 | if (local_state) { | ||
| 5025 | local_state_pref_registrar_.Init(local_state); | ||
| 5026 | - local_state_pref_registrar_.Add( | ||
| 5027 | - prefs::kGoogleServicesUsernamePattern, | ||
| 5028 | - base::BindRepeating(&PrimaryAccountPolicyManagerImpl:: | ||
| 5029 | - OnGoogleServicesUsernamePatternChanged, | ||
| 5030 | - weak_pointer_factory_.GetWeakPtr(), | ||
| 5031 | - primary_account_manager)); | ||
| 5032 | } | ||
| 5033 | - signin_allowed_.Init( | ||
| 5034 | - prefs::kSigninAllowed, client_->GetPrefs(), | ||
| 5035 | - base::BindRepeating( | ||
| 5036 | - &PrimaryAccountPolicyManagerImpl::OnSigninAllowedPrefChanged, | ||
| 5037 | - base::Unretained(this), primary_account_manager)); | ||
| 5038 | |||
| 5039 | CoreAccountInfo account_info = primary_account_manager->GetPrimaryAccountInfo( | ||
| 5040 | signin::ConsentLevel::kSync); | ||
| 5041 | --- components/signin/internal/identity_manager/primary_account_policy_manager_impl.h.orig | ||
| 5042 | +++ components/signin/internal/identity_manager/primary_account_policy_manager_impl.h | ||
| 5043 | @@ -56,9 +56,6 @@ class PrimaryAccountPolicyManagerImpl : | ||
| 5044 | // profile-specific local prefs (like kGoogleServicesUsernamePattern). | ||
| 5045 | PrefChangeRegistrar local_state_pref_registrar_; | ||
| 5046 | |||
| 5047 | - // Helper object to listen for changes to the signin allowed preference. | ||
| 5048 | - BooleanPrefMember signin_allowed_; | ||
| 5049 | - | ||
| 5050 | base::WeakPtrFactory<PrimaryAccountPolicyManagerImpl> weak_pointer_factory_{ | ||
| 5051 | this}; | ||
| 5052 | }; | ||
| 5053 | --- components/signin/internal/identity_manager/primary_account_policy_manager_impl_unittest.cc.orig | ||
| 5054 | +++ components/signin/internal/identity_manager/primary_account_policy_manager_impl_unittest.cc | ||
| 5055 | @@ -15,7 +15,6 @@ | ||
| 5056 | #include "components/signin/internal/identity_manager/primary_account_policy_manager_impl.h" | ||
| 5057 | #include "components/signin/internal/identity_manager/profile_oauth2_token_service.h" | ||
| 5058 | #include "components/signin/public/base/account_consistency_method.h" | ||
| 5059 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 5060 | #include "components/signin/public/base/test_signin_client.h" | ||
| 5061 | #include "components/sync_preferences/testing_pref_service_syncable.h" | ||
| 5062 | #include "testing/gtest/include/gtest/gtest.h" | ||
| 5063 | --- components/signin/internal/identity_manager/profile_oauth2_token_service.cc.orig | ||
| 5064 | +++ components/signin/internal/identity_manager/profile_oauth2_token_service.cc | ||
| 5065 | @@ -12,7 +12,6 @@ | ||
| 5066 | #include "components/prefs/pref_registry_simple.h" | ||
| 5067 | #include "components/signin/internal/identity_manager/profile_oauth2_token_service_delegate.h" | ||
| 5068 | #include "components/signin/public/base/device_id_helper.h" | ||
| 5069 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 5070 | #include "google_apis/gaia/gaia_constants.h" | ||
| 5071 | #include "google_apis/gaia/google_service_auth_error.h" | ||
| 5072 | #include "google_apis/gaia/oauth2_access_token_consumer.h" | ||
| 5073 | @@ -132,8 +131,6 @@ bool ProfileOAuth2TokenService::HasRefre | ||
| 5074 | // static | ||
| 5075 | void ProfileOAuth2TokenService::RegisterProfilePrefs( | ||
| 5076 | PrefRegistrySimple* registry) { | ||
| 5077 | - registry->RegisterStringPref(prefs::kGoogleServicesSigninScopedDeviceId, | ||
| 5078 | - std::string()); | ||
| 5079 | } | ||
| 5080 | |||
| 5081 | ProfileOAuth2TokenServiceDelegate* ProfileOAuth2TokenService::GetDelegate() { | ||
| 5082 | --- components/signin/internal/identity_manager/profile_oauth2_token_service_delegate_chromeos_unittest.cc.orig | ||
| 5083 | +++ components/signin/internal/identity_manager/profile_oauth2_token_service_delegate_chromeos_unittest.cc | ||
| 5084 | @@ -25,7 +25,6 @@ | ||
| 5085 | #include "components/account_manager_core/mock_account_manager_facade.h" | ||
| 5086 | #include "components/signin/internal/identity_manager/account_tracker_service.h" | ||
| 5087 | #include "components/signin/internal/identity_manager/profile_oauth2_token_service_observer.h" | ||
| 5088 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 5089 | #include "components/signin/public/base/test_signin_client.h" | ||
| 5090 | #include "components/signin/public/identity_manager/account_info.h" | ||
| 5091 | #include "components/sync_preferences/testing_pref_service_syncable.h" | ||
| 5092 | --- components/signin/public/base/BUILD.gn.orig | ||
| 5093 | +++ components/signin/public/base/BUILD.gn | ||
| 5094 | @@ -34,8 +34,6 @@ static_library("base") { | ||
| 5095 | "signin_client.h", | ||
| 5096 | "signin_metrics.cc", | ||
| 5097 | "signin_metrics.h", | ||
| 5098 | - "signin_pref_names.cc", | ||
| 5099 | - "signin_pref_names.h", | ||
| 5100 | "signin_switches.cc", | ||
| 5101 | "signin_switches.h", | ||
| 5102 | ] | ||
| 5103 | --- components/signin/public/base/device_id_helper.cc.orig | ||
| 5104 | +++ components/signin/public/base/device_id_helper.cc | ||
| 5105 | @@ -9,7 +9,6 @@ | ||
| 5106 | #include "base/guid.h" | ||
| 5107 | #include "build/chromeos_buildflags.h" | ||
| 5108 | #include "components/prefs/pref_service.h" | ||
| 5109 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 5110 | #include "components/signin/public/base/signin_switches.h" | ||
| 5111 | |||
| 5112 | namespace signin { | ||
| 5113 | @@ -17,19 +16,12 @@ namespace signin { | ||
| 5114 | #if !BUILDFLAG(IS_CHROMEOS_ASH) | ||
| 5115 | |||
| 5116 | std::string GetSigninScopedDeviceId(PrefService* prefs) { | ||
| 5117 | - if (base::CommandLine::ForCurrentProcess()->HasSwitch( | ||
| 5118 | - switches::kDisableSigninScopedDeviceId)) { | ||
| 5119 | - return std::string(); | ||
| 5120 | - } | ||
| 5121 | - | ||
| 5122 | - return GetOrCreateScopedDeviceId(prefs); | ||
| 5123 | + return std::string(); | ||
| 5124 | } | ||
| 5125 | |||
| 5126 | std::string RecreateSigninScopedDeviceId(PrefService* prefs) { | ||
| 5127 | std::string signin_scoped_device_id = GenerateSigninScopedDeviceId(); | ||
| 5128 | DCHECK(!signin_scoped_device_id.empty()); | ||
| 5129 | - prefs->SetString(prefs::kGoogleServicesSigninScopedDeviceId, | ||
| 5130 | - signin_scoped_device_id); | ||
| 5131 | return signin_scoped_device_id; | ||
| 5132 | } | ||
| 5133 | |||
| 5134 | @@ -38,13 +30,7 @@ std::string GenerateSigninScopedDeviceId | ||
| 5135 | } | ||
| 5136 | |||
| 5137 | std::string GetOrCreateScopedDeviceId(PrefService* prefs) { | ||
| 5138 | - std::string signin_scoped_device_id = | ||
| 5139 | - prefs->GetString(prefs::kGoogleServicesSigninScopedDeviceId); | ||
| 5140 | - if (signin_scoped_device_id.empty()) { | ||
| 5141 | - // If device_id doesn't exist then generate new and save in prefs. | ||
| 5142 | - signin_scoped_device_id = RecreateSigninScopedDeviceId(prefs); | ||
| 5143 | - } | ||
| 5144 | - return signin_scoped_device_id; | ||
| 5145 | + return RecreateSigninScopedDeviceId(prefs); | ||
| 5146 | } | ||
| 5147 | |||
| 5148 | #endif | ||
| 5149 | --- components/signin/public/base/device_id_helper_unittest.cc.orig | ||
| 5150 | +++ components/signin/public/base/device_id_helper_unittest.cc | ||
| 5151 | @@ -8,7 +8,6 @@ | ||
| 5152 | |||
| 5153 | #include "build/build_config.h" | ||
| 5154 | #include "build/chromeos_buildflags.h" | ||
| 5155 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 5156 | #include "components/sync_preferences/testing_pref_service_syncable.h" | ||
| 5157 | #include "testing/gtest/include/gtest/gtest.h" | ||
| 5158 | |||
| 5159 | @@ -24,40 +23,23 @@ TEST(DeviceIdHelper, GenerateSigninScope | ||
| 5160 | |||
| 5161 | TEST(DeviceIdHelper, RecreateSigninScopedDeviceId) { | ||
| 5162 | sync_preferences::TestingPrefServiceSyncable prefs; | ||
| 5163 | - prefs.registry()->RegisterStringPref( | ||
| 5164 | - prefs::kGoogleServicesSigninScopedDeviceId, std::string()); | ||
| 5165 | - ASSERT_TRUE( | ||
| 5166 | - prefs.GetString(prefs::kGoogleServicesSigninScopedDeviceId).empty()); | ||
| 5167 | |||
| 5168 | std::string device_id_1 = RecreateSigninScopedDeviceId(&prefs); | ||
| 5169 | EXPECT_FALSE(device_id_1.empty()); | ||
| 5170 | - EXPECT_EQ(device_id_1, | ||
| 5171 | - prefs.GetString(prefs::kGoogleServicesSigninScopedDeviceId)); | ||
| 5172 | |||
| 5173 | std::string device_id_2 = RecreateSigninScopedDeviceId(&prefs); | ||
| 5174 | EXPECT_FALSE(device_id_2.empty()); | ||
| 5175 | EXPECT_NE(device_id_1, device_id_2); | ||
| 5176 | - EXPECT_EQ(device_id_2, | ||
| 5177 | - prefs.GetString(prefs::kGoogleServicesSigninScopedDeviceId)); | ||
| 5178 | } | ||
| 5179 | |||
| 5180 | TEST(DeviceIdHelper, GetOrCreateScopedDeviceId) { | ||
| 5181 | sync_preferences::TestingPrefServiceSyncable prefs; | ||
| 5182 | - prefs.registry()->RegisterStringPref( | ||
| 5183 | - prefs::kGoogleServicesSigninScopedDeviceId, std::string()); | ||
| 5184 | - | ||
| 5185 | - ASSERT_TRUE( | ||
| 5186 | - prefs.GetString(prefs::kGoogleServicesSigninScopedDeviceId).empty()); | ||
| 5187 | |||
| 5188 | std::string device_id_1 = GetOrCreateScopedDeviceId(&prefs); | ||
| 5189 | EXPECT_FALSE(device_id_1.empty()); | ||
| 5190 | - EXPECT_EQ(device_id_1, | ||
| 5191 | - prefs.GetString(prefs::kGoogleServicesSigninScopedDeviceId)); | ||
| 5192 | |||
| 5193 | std::string device_id_2 = GetOrCreateScopedDeviceId(&prefs); | ||
| 5194 | EXPECT_EQ(device_id_1, device_id_2); | ||
| 5195 | - EXPECT_EQ(device_id_2, | ||
| 5196 | - prefs.GetString(prefs::kGoogleServicesSigninScopedDeviceId)); | ||
| 5197 | } | ||
| 5198 | |||
| 5199 | #endif | ||
| 5200 | --- components/signin/public/identity_manager/identity_utils.cc.orig | ||
| 5201 | +++ components/signin/public/identity_manager/identity_utils.cc | ||
| 5202 | @@ -11,7 +11,6 @@ | ||
| 5203 | #include "base/strings/string_util.h" | ||
| 5204 | #include "base/strings/utf_string_conversions.h" | ||
| 5205 | #include "components/prefs/pref_service.h" | ||
| 5206 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 5207 | #include "third_party/icu/source/i18n/unicode/regex.h" | ||
| 5208 | |||
| 5209 | namespace signin { | ||
| 5210 | @@ -56,8 +55,7 @@ bool IsUsernameAllowedByPattern(base::St | ||
| 5211 | |||
| 5212 | bool IsUsernameAllowedByPatternFromPrefs(const PrefService* prefs, | ||
| 5213 | const std::string& username) { | ||
| 5214 | - return IsUsernameAllowedByPattern( | ||
| 5215 | - username, prefs->GetString(prefs::kGoogleServicesUsernamePattern)); | ||
| 5216 | + return true; | ||
| 5217 | } | ||
| 5218 | |||
| 5219 | } // namespace signin | ||
| 5220 | --- components/signin/public/identity_manager/identity_utils_unittest.cc.orig | ||
| 5221 | +++ components/signin/public/identity_manager/identity_utils_unittest.cc | ||
| 5222 | @@ -7,7 +7,6 @@ | ||
| 5223 | #include "components/prefs/pref_registry_simple.h" | ||
| 5224 | #include "components/prefs/pref_service.h" | ||
| 5225 | #include "components/prefs/testing_pref_service.h" | ||
| 5226 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 5227 | #include "testing/gtest/include/gtest/gtest.h" | ||
| 5228 | |||
| 5229 | namespace { | ||
| 5230 | --- components/signin/public/identity_manager/primary_account_mutator_unittest.cc.orig | ||
| 5231 | +++ components/signin/public/identity_manager/primary_account_mutator_unittest.cc | ||
| 5232 | @@ -15,7 +15,6 @@ | ||
| 5233 | #include "build/chromeos_buildflags.h" | ||
| 5234 | #include "components/signin/public/base/signin_buildflags.h" | ||
| 5235 | #include "components/signin/public/base/signin_metrics.h" | ||
| 5236 | -#include "components/signin/public/base/signin_pref_names.h" | ||
| 5237 | #include "components/signin/public/identity_manager/consent_level.h" | ||
| 5238 | #include "components/signin/public/identity_manager/identity_test_environment.h" | ||
| 5239 | #include "components/signin/public/identity_manager/identity_test_utils.h" | ||
| 5240 | --- tools/metrics/histograms/enums.xml.orig | ||
| 5241 | +++ tools/metrics/histograms/enums.xml | ||
| 5242 | @@ -83754,7 +83754,6 @@ Full version information for the fingerp | ||
| 5243 | <int value="3" label="kRestoreOnStartup"/> | ||
| 5244 | <int value="4" label="kURLsToRestoreOnStartup"/> | ||
| 5245 | <int value="5" label="extensions::pref_names::kExtensions"/> | ||
| 5246 | - <int value="6" label="kGoogleServicesLastUsername"/> | ||
| 5247 | <int value="7" label="kSearchProviderOverrides"/> | ||
| 5248 | <int value="8" label="kDefaultSearchProviderSearchURL (Obsolete 12/2016)"/> | ||
| 5249 | <int value="9" label="kDefaultSearchProviderKeyword (Obsolete 12/2016)"/> | ||
| 5250 | @@ -83769,10 +83768,7 @@ Full version information for the fingerp | ||
| 5251 | <int value="18" label="kSafeBrowsingIncidentsSent"/> | ||
| 5252 | <int value="19" label="kSwReporterPromptVersion"/> | ||
| 5253 | <int value="20" label="kSwReporterPromptReason"/> | ||
| 5254 | - <int value="21" label="kGoogleServicesUsername (Obsolete 9/2019)"/> | ||
| 5255 | <int value="22" label="kSwReporterPromptSeed"/> | ||
| 5256 | - <int value="23" label="kGoogleServicesAccountId"/> | ||
| 5257 | - <int value="24" label="kGoogleServicesLastAccountId"/> | ||
| 5258 | <int value="25" label="kSettingsResetPromptPromptWave"/> | ||
| 5259 | <int value="26" label="kSettingsResetPromptLastTriggeredForDefaultSearch"/> | ||
| 5260 | <int value="27" label="kSettingsResetPromptLastTriggeredForStartupUrls"/> | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/replace-google-search-engine-with-nosearch.patch b/www/chromium-uc/patches/core/ungoogled-chromium/replace-google-search-engine-with-nosearch.patch new file mode 100644 index 0000000..0ef3743 --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/replace-google-search-engine-with-nosearch.patch | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | --- components/search_engines/prepopulated_engines.json.orig | ||
| 2 | +++ components/search_engines/prepopulated_engines.json | ||
| 3 | @@ -113,21 +113,11 @@ | ||
| 4 | }, | ||
| 5 | |||
| 6 | "google": { | ||
| 7 | - "name": "Google", | ||
| 8 | - "keyword": "google.com", | ||
| 9 | - "favicon_url": "https://www.google.com/images/branding/product/ico/googleg_lodp.ico", | ||
| 10 | - "search_url": "{google:baseURL}search?q={searchTerms}&{google:RLZ}{google:originalQueryForSuggestion}{google:assistedQueryStats}{google:searchFieldtrialParameter}{google:iOSSearchLanguage}{google:prefetchSource}{google:searchClient}{google:sourceId}{google:contextualSearchVersion}ie={inputEncoding}", | ||
| 11 | - "suggest_url": "{google:baseSuggestURL}search?{google:searchFieldtrialParameter}client={google:suggestClient}&gs_ri={google:suggestRid}&xssi=t&q={searchTerms}&{google:inputType}{google:omniboxFocusType}{google:cursorPosition}{google:currentPageUrl}{google:pageClassification}{google:searchVersion}{google:sessionToken}{google:prefetchQuery}sugkey={google:suggestAPIKeyParameter}", | ||
| 12 | - "image_url": "{google:baseSearchByImageURL}upload", | ||
| 13 | - "contextual_search_url": "{google:baseURL}_/contextualsearch?{google:contextualSearchVersion}{google:contextualSearchContextData}", | ||
| 14 | - "image_url_post_params": "encoded_image={google:imageThumbnail},image_url={google:imageURL},sbisrc={google:imageSearchSource},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight}", | ||
| 15 | - "alternate_urls": [ | ||
| 16 | - "{google:baseURL}#q={searchTerms}", | ||
| 17 | - "{google:baseURL}search#q={searchTerms}", | ||
| 18 | - "{google:baseURL}webhp#q={searchTerms}", | ||
| 19 | - "{google:baseURL}s#q={searchTerms}", | ||
| 20 | - "{google:baseURL}s?q={searchTerms}" | ||
| 21 | - ], | ||
| 22 | + "name": "No Search", | ||
| 23 | + "keyword": "nosearch", | ||
| 24 | + "favicon_url": "about:blank", | ||
| 25 | + "search_url": "http://{searchTerms}", | ||
| 26 | + "new_tab_url": "about:blank", | ||
| 27 | "type": "SEARCH_ENGINE_GOOGLE", | ||
| 28 | "preconnect_to_search_url" : "ALLOWED", | ||
| 29 | "id": 1 | ||
diff --git a/www/chromium-uc/patches/core/ungoogled-chromium/toggle-translation-via-switch.patch b/www/chromium-uc/patches/core/ungoogled-chromium/toggle-translation-via-switch.patch new file mode 100644 index 0000000..50efc58 --- /dev/null +++ b/www/chromium-uc/patches/core/ungoogled-chromium/toggle-translation-via-switch.patch | |||
| @@ -0,0 +1,115 @@ | |||
| 1 | # Disables translation and removes the "Translate to" context menu when --translate-script-url flag is not set | ||
| 2 | --- chrome/browser/renderer_context_menu/render_view_context_menu.cc.orig | ||
| 3 | +++ chrome/browser/renderer_context_menu/render_view_context_menu.cc | ||
| 4 | @@ -133,6 +133,7 @@ | ||
| 5 | #include "components/spellcheck/common/spellcheck_common.h" | ||
| 6 | #include "components/spellcheck/spellcheck_buildflags.h" | ||
| 7 | #include "components/strings/grit/components_strings.h" | ||
| 8 | +#include "components/translate/core/common/translate_switches.h" | ||
| 9 | #include "components/translate/core/browser/translate_download_manager.h" | ||
| 10 | #include "components/translate/core/browser/translate_manager.h" | ||
| 11 | #include "components/translate/core/browser/translate_prefs.h" | ||
| 12 | @@ -1751,6 +1752,8 @@ void RenderViewContextMenu::AppendPageIt | ||
| 13 | menu_model_.AddSeparator(ui::NORMAL_SEPARATOR); | ||
| 14 | } | ||
| 15 | |||
| 16 | + const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); | ||
| 17 | + if (command_line.HasSwitch(translate::switches::kTranslateScriptURL)) { | ||
| 18 | ChromeTranslateClient* chrome_translate_client = | ||
| 19 | ChromeTranslateClient::FromWebContents(embedder_web_contents_); | ||
| 20 | const bool canTranslate = | ||
| 21 | @@ -1772,6 +1775,7 @@ void RenderViewContextMenu::AppendPageIt | ||
| 22 | IDC_CONTENT_CONTEXT_TRANSLATE, | ||
| 23 | l10n_util::GetStringFUTF16(IDS_CONTENT_CONTEXT_TRANSLATE, language)); | ||
| 24 | } | ||
| 25 | + } // if (command_line.HasSwitch(translate::switches::kTranslateScriptURL)) | ||
| 26 | } | ||
| 27 | |||
| 28 | void RenderViewContextMenu::AppendExitFullscreenItem() { | ||
| 29 | --- components/translate/core/browser/translate_language_list.cc.orig | ||
| 30 | +++ components/translate/core/browser/translate_language_list.cc | ||
| 31 | @@ -11,6 +11,7 @@ | ||
| 32 | |||
| 33 | #include "base/bind.h" | ||
| 34 | #include "base/check.h" | ||
| 35 | +#include "base/command_line.h" | ||
| 36 | #include "base/json/json_reader.h" | ||
| 37 | #include "base/lazy_instance.h" | ||
| 38 | #include "base/notreached.h" | ||
| 39 | @@ -23,6 +24,7 @@ | ||
| 40 | #include "components/translate/core/browser/translate_event_details.h" | ||
| 41 | #include "components/translate/core/browser/translate_url_fetcher.h" | ||
| 42 | #include "components/translate/core/browser/translate_url_util.h" | ||
| 43 | +#include "components/translate/core/common/translate_switches.h" | ||
| 44 | #include "components/translate/core/common/translate_util.h" | ||
| 45 | #include "net/base/url_util.h" | ||
| 46 | #include "third_party/abseil-cpp/absl/types/optional.h" | ||
| 47 | @@ -219,6 +221,9 @@ GURL TranslateLanguageList::TranslateLan | ||
| 48 | } | ||
| 49 | |||
| 50 | void TranslateLanguageList::RequestLanguageList() { | ||
| 51 | + const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); | ||
| 52 | + if (!command_line.HasSwitch(translate::switches::kTranslateScriptURL)) | ||
| 53 | + return; | ||
| 54 | // If resource requests are not allowed, we'll get a callback when they are. | ||
| 55 | if (!resource_requests_allowed_) { | ||
| 56 | request_pending_ = true; | ||
| 57 | --- components/translate/core/browser/translate_manager.cc.orig | ||
| 58 | +++ components/translate/core/browser/translate_manager.cc | ||
| 59 | @@ -887,8 +887,9 @@ void TranslateManager::FilterIsTranslate | ||
| 60 | ->LogAutofillAssistantDeferredTriggerDecision(); | ||
| 61 | } | ||
| 62 | |||
| 63 | - if (!ignore_missing_key_for_testing_ && | ||
| 64 | - !::google_apis::HasAPIKeyConfigured()) { | ||
| 65 | + const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); | ||
| 66 | + if (!command_line.HasSwitch(translate::switches::kTranslateScriptURL) || | ||
| 67 | + (!ignore_missing_key_for_testing_ && !::google_apis::HasAPIKeyConfigured())) { | ||
| 68 | // Without an API key, translate won't work, so don't offer to translate in | ||
| 69 | // the first place. Leave kOfferTranslateEnabled on, though, because that | ||
| 70 | // settings syncs and we don't want to turn off translate everywhere else. | ||
| 71 | --- components/translate/core/browser/translate_ranker_impl.cc.orig | ||
| 72 | +++ components/translate/core/browser/translate_ranker_impl.cc | ||
| 73 | @@ -156,12 +156,9 @@ TranslateRankerImpl::TranslateRankerImpl | ||
| 74 | ukm::UkmRecorder* ukm_recorder) | ||
| 75 | : ukm_recorder_(ukm_recorder), | ||
| 76 | is_uma_logging_enabled_(false), | ||
| 77 | - is_query_enabled_(base::FeatureList::IsEnabled(kTranslateRankerQuery)), | ||
| 78 | - is_enforcement_enabled_( | ||
| 79 | - base::FeatureList::IsEnabled(kTranslateRankerEnforcement)), | ||
| 80 | - is_previous_language_matches_override_enabled_( | ||
| 81 | - base::FeatureList::IsEnabled( | ||
| 82 | - translate::kTranslateRankerPreviousLanguageMatchesOverride)) { | ||
| 83 | + is_query_enabled_(false), | ||
| 84 | + is_enforcement_enabled_(false), | ||
| 85 | + is_previous_language_matches_override_enabled_(false) { | ||
| 86 | if (is_query_enabled_ || is_enforcement_enabled_) { | ||
| 87 | model_loader_ = std::make_unique<assist_ranker::RankerModelLoaderImpl>( | ||
| 88 | base::BindRepeating(&ValidateModel), | ||
| 89 | @@ -235,6 +232,8 @@ bool TranslateRankerImpl::ShouldOfferTra | ||
| 90 | // (or become False). | ||
| 91 | const bool kDefaultResponse = true; | ||
| 92 | |||
| 93 | + return kDefaultResponse; | ||
| 94 | + | ||
| 95 | translate_event->set_ranker_request_timestamp_sec( | ||
| 96 | (base::TimeTicks::Now() - base::TimeTicks()).InSeconds()); | ||
| 97 | translate_event->set_ranker_version(GetModelVersion()); | ||
| 98 | --- components/translate/core/browser/translate_script.cc.orig | ||
| 99 | +++ components/translate/core/browser/translate_script.cc | ||
| 100 | @@ -137,8 +137,13 @@ void TranslateScript::OnScriptFetchCompl | ||
| 101 | server_params.c_str()); | ||
| 102 | |||
| 103 | GURL security_origin = translate::GetTranslateSecurityOrigin(); | ||
| 104 | - base::StringAppendF(&data_, "var securityOrigin = '%s';", | ||
| 105 | - security_origin.spec().c_str()); | ||
| 106 | + const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); | ||
| 107 | + if (command_line.HasSwitch(translate::switches::kTranslateScriptURL)) { | ||
| 108 | + base::StringAppendF(&data_, "var securityOrigin = '%s';", | ||
| 109 | + security_origin.spec().c_str()); | ||
| 110 | + } else { | ||
| 111 | + base::StringAppendF(&data_, "var securityOrigin = '';"); | ||
| 112 | + } | ||
| 113 | |||
| 114 | // Load embedded translate.js. | ||
| 115 | data_.append(ui::ResourceBundle::GetSharedInstance().LoadDataResourceString( | ||
