Commit c976e6be authored by Conley Owens's avatar Conley Owens Committed by Commit Bot

prefs: Remove some old prefs

This change removes prefs that have been deprecated for over a year.

Change-Id: Icc01ff3a4cf48452a9235e5d4e2d460d9d498ad6
Reviewed-on: https://chromium-review.googlesource.com/1019886Reviewed-by: default avatarDerek Cheng <imcheng@chromium.org>
Reviewed-by: default avatarTakumi Fujimoto <takumif@chromium.org>
Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Commit-Queue: Conley Owens <cco3@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552126}
parent 400802e2
......@@ -293,23 +293,6 @@
namespace {
#if BUILDFLAG(ENABLE_EXTENSIONS)
// Deprecated 2/2017.
constexpr char kToolbarMigratedComponentActionStatus[] =
"toolbar_migrated_component_action_status";
#endif
#if BUILDFLAG(ENABLE_RLZ)
// Migrated out of kDistroDict as of 2/2017.
constexpr char kDistroRlzPingDelay[] = "ping_delay";
#endif // BUILDFLAG(ENABLE_RLZ)
// master_preferences used to be mapped as-is to Preferences on first run but
// the "distribution" dictionary was never used beyond first run. It is now
// stripped in first_run.cc prior to applying this mapping. Cleanup for existing
// Preferences files added here 2/2017.
constexpr char kDistroDict[] = "distribution";
#if defined(OS_ANDROID)
// Deprecated 8/2017.
const char kStabilityForegroundActivityType[] =
......@@ -337,11 +320,6 @@ const char kTouchHudProjectionEnabled[] = "touch_hud.projection_enabled";
// Register prefs used only for migration (clearing or moving to a new key).
void RegisterProfilePrefsForMigration(
user_prefs::PrefRegistrySyncable* registry) {
#if BUILDFLAG(ENABLE_EXTENSIONS)
registry->RegisterDictionaryPref(kToolbarMigratedComponentActionStatus);
#endif
registry->RegisterDictionaryPref(kDistroDict);
registry->RegisterStringPref(kInstantUIZeroSuggestUrlPrefix, std::string());
#if defined(OS_CHROMEOS)
......@@ -730,39 +708,6 @@ void MigrateObsoleteBrowserPrefs(Profile* profile, PrefService* local_state) {
void MigrateObsoleteProfilePrefs(Profile* profile) {
PrefService* profile_prefs = profile->GetPrefs();
#if BUILDFLAG(ENABLE_EXTENSIONS)
// Added 2/2017.
// NOTE(takumif): When removing this code, also remove the following tests:
// - MediaRouterUIBrowserTest.MigrateToolbarIconShownPref
// - MediaRouterUIBrowserTest.MigrateToolbarIconUnshownPref
{
bool show_cast_icon = false;
const base::DictionaryValue* action_migration_dict =
profile_prefs->GetDictionary(kToolbarMigratedComponentActionStatus);
if (action_migration_dict &&
action_migration_dict->GetBoolean(
ComponentToolbarActionsFactory::kMediaRouterActionId,
&show_cast_icon)) {
profile_prefs->SetBoolean(prefs::kShowCastIconInToolbar, show_cast_icon);
}
profile_prefs->ClearPref(kToolbarMigratedComponentActionStatus);
}
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
// Added 2/2017.
{
#if BUILDFLAG(ENABLE_RLZ)
const base::DictionaryValue* distro_dict =
profile_prefs->GetDictionary(kDistroDict);
int rlz_ping_delay = 0;
if (distro_dict &&
distro_dict->GetInteger(kDistroRlzPingDelay, &rlz_ping_delay)) {
profile_prefs->SetInteger(prefs::kRlzPingDelaySeconds, rlz_ping_delay);
}
#endif // BUILDFLAG(ENABLE_RLZ)
profile_prefs->ClearPref(kDistroDict);
}
// Added 11/2017.
profile_prefs->ClearPref(kInstantUIZeroSuggestUrlPrefix);
......
......@@ -30,11 +30,6 @@
#include "content/public/test/test_utils.h"
#include "ui/views/widget/widget.h"
namespace {
constexpr char kToolbarMigratedComponentActionStatus[] =
"toolbar_migrated_component_action_status";
}
namespace media_router {
class MediaRouterUIBrowserTest : public InProcessBrowserTest {
......@@ -105,18 +100,6 @@ class MediaRouterUIBrowserTest : public InProcessBrowserTest {
always_show);
}
// Sets the old preference to show the toolbar action icon to |always_show|,
// and migrates the preference.
void MigrateToolbarIconPref(bool always_show) {
{
DictionaryPrefUpdate update(browser()->profile()->GetPrefs(),
kToolbarMigratedComponentActionStatus);
update->SetBoolean(ComponentToolbarActionsFactory::kMediaRouterActionId,
always_show);
}
MigrateObsoleteProfilePrefs(browser()->profile());
}
protected:
ToolbarActionsBar* toolbar_actions_bar_ = nullptr;
......@@ -352,17 +335,4 @@ IN_PROC_BROWSER_TEST_F(MediaRouterUIBrowserTest, UpdateActionLocation) {
toolbar_actions_bar_->IsActionVisibleOnMainBar(GetMediaRouterAction()));
}
IN_PROC_BROWSER_TEST_F(MediaRouterUIBrowserTest, MigrateToolbarIconShownPref) {
MigrateToolbarIconPref(true);
EXPECT_TRUE(MediaRouterActionController::GetAlwaysShowActionPref(
browser()->profile()));
}
IN_PROC_BROWSER_TEST_F(MediaRouterUIBrowserTest,
MigrateToolbarIconUnshownPref) {
MigrateToolbarIconPref(false);
EXPECT_FALSE(MediaRouterActionController::GetAlwaysShowActionPref(
browser()->profile()));
}
} // namespace media_router
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment