diff options
Diffstat (limited to 'www/chromium-uc/patches/core/ungoogled-chromium/remove-unused-preferences-fields.patch')
| -rw-r--r-- | www/chromium-uc/patches/core/ungoogled-chromium/remove-unused-preferences-fields.patch | 5260 |
1 files changed, 5260 insertions, 0 deletions
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"/> | ||
