LeOSium_webview/LeOS/patches/Modify-default-preferences....

342 lines
17 KiB
Diff
Raw Normal View History

2023-11-18 11:46:19 +01:00
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 2 May 2020 00:25:25 +0200
Subject: Modify default preferences
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
chrome/browser/about_flags.cc | 6 ++++++
.../background/background_mode_manager.cc | 2 +-
.../browser/chrome_content_browser_client.cc | 2 +-
chrome/browser/flag_descriptions.cc | 5 +++++
chrome/browser/flag_descriptions.h | 3 +++
chrome/browser/preloading/preloading_prefs.h | 2 +-
chrome/browser/profiles/profile.cc | 2 +-
.../reset_page/reset_profile_dialog.html | 2 +-
chrome/browser/ui/browser_ui_prefs.cc | 4 ++--
components/bookmarks/browser/BUILD.gn | 2 ++
components/bookmarks/browser/bookmark_utils.cc | 7 +++++--
components/bookmarks/browser/features.cc | 16 ++++++++++++++++
components/bookmarks/browser/features.h | 18 ++++++++++++++++++
.../core/browser/content_settings_registry.cc | 4 ++--
.../core/browser/cookie_settings.cc | 2 +-
components/payments/core/payment_prefs.cc | 2 +-
.../core/common/safe_browsing_prefs.cc | 4 ++--
.../primary_account_manager.cc | 4 ++--
third_party/blink/common/features.cc | 4 ++--
19 files changed, 72 insertions(+), 19 deletions(-)
create mode 100644 components/bookmarks/browser/features.cc
create mode 100644 components/bookmarks/browser/features.h
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -78,6 +78,7 @@
#include "components/autofill/core/common/autofill_payments_features.h"
#include "components/autofill/core/common/autofill_switches.h"
#include "components/autofill/core/common/autofill_util.h"
+#include "components/bookmarks/browser/features.h"
#include "components/browser_sync/browser_sync_switches.h"
#include "components/browsing_data/core/features.h"
#include "components/commerce/core/commerce_feature_list.h"
@@ -6775,6 +6776,11 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(features::kQuickSettingsPWANotifications)},
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+ {"apps-shortcut-default-off",
+ flag_descriptions::kAppsShortcutDefaultOffName,
+ flag_descriptions::kAppsShortcutDefaultOffDescription, kOsDesktop,
+ FEATURE_VALUE_TYPE(bookmarks::features::kAppsShortcutDefaultOff)},
+
{flag_descriptions::kTabGroupsSaveId, flag_descriptions::kTabGroupsSaveName,
flag_descriptions::kTabGroupsSaveDescription, kOsDesktop,
FEATURE_VALUE_TYPE(features::kTabGroupsSave)},
diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/browser/background/background_mode_manager.cc
--- a/chrome/browser/background/background_mode_manager.cc
+++ b/chrome/browser/background/background_mode_manager.cc
@@ -359,7 +359,7 @@ BackgroundModeManager::~BackgroundModeManager() {
// static
void BackgroundModeManager::RegisterPrefs(PrefRegistrySimple* registry) {
- registry->RegisterBooleanPref(prefs::kBackgroundModeEnabled, true);
+ registry->RegisterBooleanPref(prefs::kBackgroundModeEnabled, false);
}
void BackgroundModeManager::RegisterProfile(Profile* profile) {
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1608,7 +1608,7 @@ void ChromeContentBrowserClient::RegisterLocalStatePrefs(
void ChromeContentBrowserClient::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(prefs::kDisable3DAPIs, false);
- registry->RegisterBooleanPref(prefs::kEnableHyperlinkAuditing, true);
+ registry->RegisterBooleanPref(prefs::kEnableHyperlinkAuditing, false);
// Register user prefs for mapping SitePerProcess and IsolateOrigins in
// user policy in addition to the same named ones in Local State (which are
// used for mapping the command-line flags).
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -3316,6 +3316,11 @@ const char kCommerceMerchantViewerAndroidDescription[] =
"Allows users to view merchant trust signals on eligible pages.";
const char kTabGroupsSaveId[] = "tab-groups-save";
+
+const char kAppsShortcutDefaultOffName[] = "Apps Shortcut Default Off";
+const char kAppsShortcutDefaultOffDescription[] =
+ "Changes the apps shortcut on the bookmarks bar to default to off.";
+
const char kTabGroupsSaveName[] = "Tab Groups Save and Sync";
const char kTabGroupsSaveDescription[] =
"Enable saving and recalling of tab groups. Right click a tab group to "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -1911,6 +1911,9 @@ extern const char kCommerceMerchantViewerAndroidName[];
extern const char kCommerceMerchantViewerAndroidDescription[];
extern const char kTabGroupsSaveId[];
+extern const char kAppsShortcutDefaultOffName[];
+extern const char kAppsShortcutDefaultOffDescription[];
+
extern const char kTabGroupsSaveName[];
extern const char kTabGroupsSaveDescription[];
diff --git a/chrome/browser/preloading/preloading_prefs.h b/chrome/browser/preloading/preloading_prefs.h
--- a/chrome/browser/preloading/preloading_prefs.h
+++ b/chrome/browser/preloading/preloading_prefs.h
@@ -23,7 +23,7 @@ enum class NetworkPredictionOptions {
kWifiOnlyDeprecated = 1,
kDisabled = 2,
kExtended = 3,
- kDefault = kWifiOnlyDeprecated,
+ kDefault = kDisabled,
};
// Enum representing possible values of the Preload Pages opt-in state. These
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
--- a/chrome/browser/profiles/profile.cc
+++ b/chrome/browser/profiles/profile.cc
@@ -310,7 +310,7 @@ const char Profile::kProfileKey[] = "__PROFILE__";
void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
prefs::kSearchSuggestEnabled,
- true,
+ false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
#if BUILDFLAG(IS_ANDROID)
registry->RegisterStringPref(
diff --git a/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html b/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html
--- a/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html
+++ b/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html
@@ -34,7 +34,7 @@
</cr-button>
</div>
<div slot="footer">
- <cr-checkbox id="sendSettings" checked>
+ <cr-checkbox id="sendSettings">
$i18nRaw{resetPageFeedback}</cr-checkbox>
</div>
</cr-dialog>
diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc
--- a/chrome/browser/ui/browser_ui_prefs.cc
+++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -82,10 +82,10 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(prefs::kWebAppCreateInAppsMenu, true);
registry->RegisterBooleanPref(prefs::kWebAppCreateInQuickLaunchBar, true);
registry->RegisterBooleanPref(
- translate::prefs::kOfferTranslateEnabled, true,
+ translate::prefs::kOfferTranslateEnabled, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterStringPref(prefs::kCloudPrintEmail, std::string());
- registry->RegisterBooleanPref(prefs::kCloudPrintProxyEnabled, true);
+ registry->RegisterBooleanPref(prefs::kCloudPrintProxyEnabled, false);
registry->RegisterDictionaryPref(prefs::kBrowserWindowPlacement);
registry->RegisterDictionaryPref(prefs::kBrowserWindowPlacementPopup);
registry->RegisterDictionaryPref(prefs::kAppWindowPlacement);
diff --git a/components/bookmarks/browser/BUILD.gn b/components/bookmarks/browser/BUILD.gn
--- a/components/bookmarks/browser/BUILD.gn
+++ b/components/bookmarks/browser/BUILD.gn
@@ -20,6 +20,7 @@ static_library("browser") {
"bookmark_undo_provider.h",
"bookmark_utils.h",
"bookmark_uuids.h",
+ "features.h",
"history_bookmark_model.h",
"model_loader.h",
"scoped_group_bookmark_actions.h",
@@ -42,6 +43,7 @@ static_library("browser") {
"bookmark_storage.cc",
"bookmark_utils.cc",
"bookmark_uuids.cc",
+ "features.cc",
"model_loader.cc",
"scoped_group_bookmark_actions.cc",
"titled_url_index.cc",
diff --git a/components/bookmarks/browser/bookmark_utils.cc b/components/bookmarks/browser/bookmark_utils.cc
--- a/components/bookmarks/browser/bookmark_utils.cc
+++ b/components/bookmarks/browser/bookmark_utils.cc
@@ -26,6 +26,7 @@
#include "build/build_config.h"
#include "components/bookmarks/browser/bookmark_client.h"
#include "components/bookmarks/browser/bookmark_model.h"
+#include "components/bookmarks/browser/features.h"
#include "components/bookmarks/browser/scoped_group_bookmark_actions.h"
#include "components/bookmarks/common/bookmark_pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h"
@@ -483,11 +484,13 @@ bool DoesBookmarkContainWords(const std::u16string& title,
void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
- prefs::kShowBookmarkBar, false,
+ prefs::kShowBookmarkBar, true,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(prefs::kEditBookmarksEnabled, true);
registry->RegisterBooleanPref(
- prefs::kShowAppsShortcutInBookmarkBar, false,
+ prefs::kShowAppsShortcutInBookmarkBar,
+ base::FeatureList::IsEnabled(features::kAppsShortcutDefaultOff) ? false
+ : true,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kShowManagedBookmarksInBookmarkBar, true,
diff --git a/components/bookmarks/browser/features.cc b/components/bookmarks/browser/features.cc
new file mode 100644
--- /dev/null
+++ b/components/bookmarks/browser/features.cc
@@ -0,0 +1,16 @@
+// Copyright 2021 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/bookmarks/browser/features.h"
+
+namespace bookmarks {
+namespace features {
+
+// Changes the apps shortcut on the bookmarks bar to default to off.
+// https://crbug.com/1236793
+const base::Feature kAppsShortcutDefaultOff{"AppsShortcutDefaultOff",
+ base::FEATURE_ENABLED_BY_DEFAULT};
+
+} // namespace features
+} // namespace bookmarks
diff --git a/components/bookmarks/browser/features.h b/components/bookmarks/browser/features.h
new file mode 100644
--- /dev/null
+++ b/components/bookmarks/browser/features.h
@@ -0,0 +1,18 @@
+// Copyright 2021 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_BOOKMARKS_BROWSER_FEATURES_H_
+#define COMPONENTS_BOOKMARKS_BROWSER_FEATURES_H_
+
+#include "base/feature_list.h"
+
+namespace bookmarks {
+namespace features {
+
+extern const base::Feature kAppsShortcutDefaultOff;
+
+} // namespace features
+} // namespace bookmarks
+
+#endif // COMPONENTS_BOOKMARKS_BROWSER_FEATURES_H_
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
--- a/components/content_settings/core/browser/content_settings_registry.cc
+++ b/components/content_settings/core/browser/content_settings_registry.cc
@@ -236,7 +236,7 @@ void ContentSettingsRegistry::Init() {
ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY);
Register(ContentSettingsType::BACKGROUND_SYNC, "background-sync",
- CONTENT_SETTING_ALLOW, WebsiteSettingsInfo::UNSYNCABLE,
+ CONTENT_SETTING_BLOCK, WebsiteSettingsInfo::UNSYNCABLE,
/*allowlisted_schemes=*/{},
/*valid_settings=*/{CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK},
WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE,
@@ -337,7 +337,7 @@ void ContentSettingsRegistry::Init() {
// TODO(crbug.com/904439): Update this to "SECURE_ONLY" once
// DeviceOrientationEvents and DeviceMotionEvents are only fired in secure
// contexts.
- Register(ContentSettingsType::SENSORS, "sensors", CONTENT_SETTING_ALLOW,
+ Register(ContentSettingsType::SENSORS, "sensors", CONTENT_SETTING_BLOCK,
WebsiteSettingsInfo::UNSYNCABLE, /*allowlisted_schemes=*/{},
/*valid_settings=*/{CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK},
WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE,
diff --git a/components/content_settings/core/browser/cookie_settings.cc b/components/content_settings/core/browser/cookie_settings.cc
--- a/components/content_settings/core/browser/cookie_settings.cc
+++ b/components/content_settings/core/browser/cookie_settings.cc
@@ -74,7 +74,7 @@ void CookieSettings::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterIntegerPref(
prefs::kCookieControlsMode,
- static_cast<int>(CookieControlsMode::kIncognitoOnly),
+ static_cast<int>(CookieControlsMode::kBlockThirdParty), // this is the default in Bromite, overridden from kIncognitoOnly
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
}
diff --git a/components/payments/core/payment_prefs.cc b/components/payments/core/payment_prefs.cc
--- a/components/payments/core/payment_prefs.cc
+++ b/components/payments/core/payment_prefs.cc
@@ -16,7 +16,7 @@ const char kCanMakePaymentEnabled[] = "payments.can_make_payment_enabled";
void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(kPaymentsFirstTransactionCompleted, false);
registry->RegisterBooleanPref(
- kCanMakePaymentEnabled, true,
+ kCanMakePaymentEnabled, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
}
diff --git a/components/safe_browsing/core/common/safe_browsing_prefs.cc b/components/safe_browsing/core/common/safe_browsing_prefs.cc
--- a/components/safe_browsing/core/common/safe_browsing_prefs.cc
+++ b/components/safe_browsing/core/common/safe_browsing_prefs.cc
@@ -271,13 +271,13 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(
prefs::kSafeBrowsingSawInterstitialScoutReporting, false);
registry->RegisterBooleanPref(
- prefs::kSafeBrowsingExtendedReportingOptInAllowed, true);
+ prefs::kSafeBrowsingExtendedReportingOptInAllowed, false);
registry->RegisterTimePref(
prefs::kSafeBrowsingEsbProtegoPingWithTokenLastLogTime, base::Time());
registry->RegisterTimePref(
prefs::kSafeBrowsingEsbProtegoPingWithoutTokenLastLogTime, base::Time());
registry->RegisterBooleanPref(
- prefs::kSafeBrowsingEnabled, true,
+ prefs::kSafeBrowsingEnabled, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(prefs::kSafeBrowsingEnhanced, false);
registry->RegisterBooleanPref(prefs::kSafeBrowsingProceedAnywayDisabled,
diff --git a/components/signin/internal/identity_manager/primary_account_manager.cc b/components/signin/internal/identity_manager/primary_account_manager.cc
--- a/components/signin/internal/identity_manager/primary_account_manager.cc
+++ b/components/signin/internal/identity_manager/primary_account_manager.cc
@@ -147,9 +147,9 @@ void PrimaryAccountManager::RegisterProfilePrefs(PrefRegistrySimple* registry) {
std::string());
registry->RegisterStringPref(prefs::kGoogleServicesAccountId, std::string());
registry->RegisterBooleanPref(prefs::kGoogleServicesConsentedToSync, false);
- registry->RegisterBooleanPref(prefs::kAutologinEnabled, true);
+ registry->RegisterBooleanPref(prefs::kAutologinEnabled, false);
registry->RegisterListPref(prefs::kReverseAutologinRejectedEmailList);
- registry->RegisterBooleanPref(prefs::kSigninAllowed, true);
+ registry->RegisterBooleanPref(prefs::kSigninAllowed, false);
registry->RegisterBooleanPref(prefs::kSignedInWithCredentialProvider, false);
}
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -987,8 +987,8 @@ const base::FeatureParam<int> kInterestGroupStorageMaxOpsBeforeMaintenance{
// the attribute. Note: At present, only iframes with origin-restricted
// sandboxes are isolated.
BASE_FEATURE(kIsolateSandboxedIframes,
- "IsolateSandboxedIframes",
- base::FEATURE_DISABLED_BY_DEFAULT);
+ "IsolateSandboxedIframes", // enabled by default
+ base::FEATURE_ENABLED_BY_DEFAULT); // in Bromite
const base::FeatureParam<IsolateSandboxedIframesGrouping>::Option
isolated_sandboxed_iframes_grouping_types[] = {
{IsolateSandboxedIframesGrouping::kPerSite, "per-site"},
--
2.25.1