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            |  4 ++++
 chrome/browser/flag_descriptions.h             |  3 +++
 chrome/browser/prefetch/prefetch_prefs.h       |  2 +-
 chrome/browser/profiles/profile.cc             |  2 +-
 .../reset_page/reset_profile_dialog.html       |  2 +-
 chrome/browser/ui/browser_ui_prefs.cc          |  6 +++---
 components/bookmarks/browser/BUILD.gn          |  2 ++
 components/bookmarks/browser/bookmark_utils.cc |  8 ++++++--
 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 ++--
 content/public/common/content_features.cc      |  4 ++--
 19 files changed, 73 insertions(+), 20 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
@@ -79,6 +79,7 @@
 #include "components/autofill/core/common/autofill_switches.h"
 #include "components/autofill/core/common/autofill_util.h"
 #include "components/autofill_assistant/browser/features.h"
+#include "components/bookmarks/browser/features.h"
 #include "components/browser_sync/browser_sync_switches.h"
 #include "components/browser_ui/site_settings/android/features.h"
 #include "components/browsing_data/core/features.h"
@@ -5937,6 +5938,11 @@ const FeatureEntry kFeatureEntries[] = {
          reading_list::switches::kReadLaterReminderNotification)},
 #endif
 
+    {"apps-shortcut-default-off",
+     flag_descriptions::kAppsShortcutDefaultOffName,
+     flag_descriptions::kAppsShortcutDefaultOffDescription, kOsDesktop,
+     FEATURE_VALUE_TYPE(bookmarks::features::kAppsShortcutDefaultOff)},
+
     {"tab-groups-new-badge-promo",
      flag_descriptions::kTabGroupsNewBadgePromoName,
      flag_descriptions::kTabGroupsNewBadgePromoDescription, kOsDesktop,
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
@@ -377,7 +377,7 @@ void BackgroundModeManager::RegisterPrefs(PrefRegistrySimple* registry) {
   registry->RegisterBooleanPref(prefs::kChromeCreatedLoginItem, false);
   registry->RegisterBooleanPref(prefs::kMigratedLoginItemPref, false);
 #endif
-  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
@@ -1435,7 +1435,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
@@ -2920,6 +2920,10 @@ const char kTabToGTSAnimationAndroidDescription[] =
     "Allows users to see an animation when entering or leaving the "
     "Grid Tab Switcher on phones.";
 
+const char kAppsShortcutDefaultOffName[] = "Apps Shortcut Default Off";
+const char kAppsShortcutDefaultOffDescription[] =
+    "Changes the apps shortcut on the bookmarks bar to default to off.";
+
 const char kTabGroupsNewBadgePromoName[] = "Tab Groups 'New' Badge Promo";
 const char kTabGroupsNewBadgePromoDescription[] =
     "Causes a 'New' badge to appear on the entry point for creating a tab "
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
@@ -1641,6 +1641,9 @@ extern const char kTabGroupsUiImprovementsAndroidDescription[];
 extern const char kTabToGTSAnimationAndroidName[];
 extern const char kTabToGTSAnimationAndroidDescription[];
 
+extern const char kAppsShortcutDefaultOffName[];
+extern const char kAppsShortcutDefaultOffDescription[];
+
 extern const char kTabGroupsNewBadgePromoName[];
 extern const char kTabGroupsNewBadgePromoDescription[];
 
diff --git a/chrome/browser/prefetch/prefetch_prefs.h b/chrome/browser/prefetch/prefetch_prefs.h
--- a/chrome/browser/prefetch/prefetch_prefs.h
+++ b/chrome/browser/prefetch/prefetch_prefs.h
@@ -25,7 +25,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.  Since
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
@@ -302,7 +302,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
@@ -36,7 +36,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
@@ -77,11 +77,11 @@ 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::kCloudPrintSubmitEnabled, true);
+  registry->RegisterBooleanPref(prefs::kCloudPrintProxyEnabled, false);
+  registry->RegisterBooleanPref(prefs::kCloudPrintSubmitEnabled, 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
@@ -21,6 +21,7 @@ static_library("browser") {
     "bookmark_undo_delegate.h",
     "bookmark_undo_provider.h",
     "bookmark_utils.h",
+    "features.h",
     "history_bookmark_model.h",
     "model_loader.h",
     "scoped_group_bookmark_actions.h",
@@ -43,6 +44,7 @@ static_library("browser") {
     "bookmark_node_data.cc",
     "bookmark_storage.cc",
     "bookmark_utils.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
@@ -25,6 +25,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_metrics.h"
 #include "components/bookmarks/common/bookmark_pref_names.h"
@@ -443,11 +444,14 @@ 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
@@ -311,7 +311,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,
            AllowlistedSchemes(),
            ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK),
            WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE,
@@ -411,7 +411,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, AllowlistedSchemes(),
            ValidSettings(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
@@ -66,7 +66,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
@@ -199,9 +199,9 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
   registry->RegisterBooleanPref(
       prefs::kSafeBrowsingSawInterstitialScoutReporting, false);
   registry->RegisterBooleanPref(
-      prefs::kSafeBrowsingExtendedReportingOptInAllowed, true);
+      prefs::kSafeBrowsingExtendedReportingOptInAllowed, false);
   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
@@ -50,9 +50,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/content/public/common/content_features.cc b/content/public/common/content_features.cc
--- a/content/public/common/content_features.cc
+++ b/content/public/common/content_features.cc
@@ -540,8 +540,8 @@ const char kIsolateOriginsFieldTrialParamName[] = "OriginsList";
 // 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
