[ntp][modules] Add standardized removal controls
Adds an action menu to <ntp-module-header> that allows the user to
dismiss and disable a module (screenshot/7GHs68F5WYbpVJ8); and makes all
modules use that new functionality. Also, adds various variations of
each module's name and uses those in the different UIs where we refer to
individual modules.
The new module removal model is in large parts based on the Chrome cart
module's removal model. Therefore, this CL cleans up Chrome cart removal
code that is no longer needed.
Bug: 1177464
Change-Id: I1809fb2cda92deeee13e7393088287311d284b57
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2719121
Commit-Queue: Tibor Goldschwendt <[email protected]>
Auto-Submit: Tibor Goldschwendt <[email protected]>
Reviewed-by: Moe Ahmadi <[email protected]>
Reviewed-by: Alex Gough <[email protected]>
Reviewed-by: Gabriel Charette <[email protected]>
Reviewed-by: Yue Zhang <[email protected]>
Cr-Commit-Position: refs/heads/master@{#858234}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index fbfeff0..853eff9 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -554,6 +554,11 @@
// Deprecated 02/2021
const char kGamesInstallDirPref[] = "games.data_files_paths";
+#if !defined(OS_ANDROID)
+// Deprecated 02/2021
+const char kCartModuleRemoved[] = "cart_module_removed";
+#endif
+
// Register local state used only for migration (clearing or moving to a new
// key).
void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
@@ -665,6 +670,10 @@
registry->RegisterStringPref(kDataReductionProxyConfig, std::string());
registry->RegisterFilePathPref(kGamesInstallDirPref, base::FilePath());
+
+#if !defined(OS_ANDROID)
+ registry->RegisterBooleanPref(kCartModuleRemoved, false);
+#endif
}
} // namespace
@@ -1345,6 +1354,11 @@
// Added 02/2021
profile_prefs->ClearPref(kGamesInstallDirPref);
+#if !defined(OS_ANDROID)
+ // Added 02/2021
+ profile_prefs->ClearPref(kCartModuleRemoved);
+#endif
+
// Please don't delete the following line. It is used by PRESUBMIT.py.
// END_MIGRATE_OBSOLETE_PROFILE_PREFS
}