From 8200bc89bcd0bcde230280dcd1a0d8b552c9fb8b Mon Sep 17 00:00:00 2001 From: "xiyuan@chromium.org" Date: Wed, 5 Dec 2012 05:36:16 +0000 Subject: [PATCH] cleanup: Remove pinned app pref M19-M20 migration code. The migration code for pinned apps pref from M19 to M20 is obsolete now. BUG=none. TEST=No change. New user gets 4 default pinned apps. Unpin all should stay that way on the next login. R=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/11434114 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171169 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/ui/ash/chrome_launcher_prefs.cc | 3 --- .../launcher/chrome_launcher_controller_per_app.cc | 27 ---------------------- .../chrome_launcher_controller_per_browser.cc | 27 ---------------------- chrome/common/pref_names.cc | 5 +--- chrome/common/pref_names.h | 1 - 5 files changed, 1 insertion(+), 62 deletions(-) diff --git a/chrome/browser/ui/ash/chrome_launcher_prefs.cc b/chrome/browser/ui/ash/chrome_launcher_prefs.cc index f86d9f834d15..15b6d7e00277 100644 --- a/chrome/browser/ui/ash/chrome_launcher_prefs.cc +++ b/chrome/browser/ui/ash/chrome_launcher_prefs.cc @@ -44,9 +44,6 @@ extern const char kShelfAlignmentRight[] = "Right"; void RegisterChromeLauncherUserPrefs(PrefService* user_prefs) { // TODO: If we want to support multiple profiles this will likely need to be // pushed to local state and we'll need to track profile per item. - user_prefs->RegisterBooleanPref(prefs::kUseDefaultPinnedApps, - true, - PrefService::SYNCABLE_PREF); user_prefs->RegisterListPref(prefs::kPinnedLauncherApps, CreateDefaultPinnedAppsList(), PrefService::SYNCABLE_PREF); diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.cc index 5895692a2f78..46a7b7bcb93e 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.cc @@ -209,29 +209,6 @@ ChromeLauncherControllerPerApp::~ChromeLauncherControllerPerApp() { } void ChromeLauncherControllerPerApp::Init() { - // TODO(xiyuan): Remove migration code and kUseDefaultPinnedApp after M20. - // Migration cases: - // - Users that unpin all apps: - // - have default pinned apps - // - kUseDefaultPinnedApps set to false - // Migrate them by setting an empty list for kPinnedLauncherApps. - // - // - Users that have customized pinned apps: - // - have non-default non-empty pinned apps list - // - kUseDefaultPinnedApps set to false - // Nothing needs to be done because customized pref overrides default. - // - // - Users that have default apps (i.e. new user or never pin/unpin): - // - have default pinned apps - // - kUseDefaultPinnedApps is still true - // Nothing needs to be done because they should get the default. - if (profile_->GetPrefs()->FindPreference( - prefs::kPinnedLauncherApps)->IsDefaultValue() && - !profile_->GetPrefs()->GetBoolean(prefs::kUseDefaultPinnedApps)) { - ListPrefUpdate updater(profile_->GetPrefs(), prefs::kPinnedLauncherApps); - updater.Get()->Clear(); - } - UpdateAppLaunchersFromPref(); // TODO(sky): update unit test so that this test isn't necessary. @@ -856,10 +833,6 @@ void ChromeLauncherControllerPerApp::PersistPinnedState() { return; } - // Set kUseDefaultPinnedApps to false and use pinned apps list from prefs - // from now on. - profile_->GetPrefs()->SetBoolean(prefs::kUseDefaultPinnedApps, false); - // Mutating kPinnedLauncherApps is going to notify us and trigger us to // process the change. We don't want that to happen so remove ourselves as a // listener. diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser.cc index 920653fe9477..9c91f5d86587 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser.cc @@ -213,29 +213,6 @@ ChromeLauncherControllerPerBrowser::~ChromeLauncherControllerPerBrowser() { } void ChromeLauncherControllerPerBrowser::Init() { - // TODO(xiyuan): Remove migration code and kUseDefaultPinnedApp after M20. - // Migration cases: - // - Users that unpin all apps: - // - have default pinned apps - // - kUseDefaultPinnedApps set to false - // Migrate them by setting an empty list for kPinnedLauncherApps. - // - // - Users that have customized pinned apps: - // - have non-default non-empty pinned apps list - // - kUseDefaultPinnedApps set to false - // Nothing needs to be done because customized pref overrides default. - // - // - Users that have default apps (i.e. new user or never pin/unpin): - // - have default pinned apps - // - kUseDefaultPinnedApps is still true - // Nothing needs to be done because they should get the default. - if (profile_->GetPrefs()->FindPreference( - prefs::kPinnedLauncherApps)->IsDefaultValue() && - !profile_->GetPrefs()->GetBoolean(prefs::kUseDefaultPinnedApps)) { - ListPrefUpdate updater(profile_->GetPrefs(), prefs::kPinnedLauncherApps); - updater.Get()->Clear(); - } - UpdateAppLaunchersFromPref(); // TODO(sky): update unit test so that this test isn't necessary. @@ -863,10 +840,6 @@ void ChromeLauncherControllerPerBrowser::PersistPinnedState() { return; } - // Set kUseDefaultPinnedApps to false and use pinned apps list from prefs - // from now on. - profile_->GetPrefs()->SetBoolean(prefs::kUseDefaultPinnedApps, false); - // Mutating kPinnedLauncherApps is going to notify us and trigger us to // process the change. We don't want that to happen so remove ourselves as a // listener. diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index ebdabfaf2463..842fb08cae9e 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -2080,10 +2080,7 @@ const char kShelfAlignmentLocal[] = "shelf_alignment_local"; // String value corresponding to ash::Shell::ShelfAutoHideBehavior. const char kShelfAutoHideBehavior[] = "auto_hide_behavior"; const char kShelfAutoHideBehaviorLocal[] = "auto_hide_behavior_local"; -// Boolean value indicating whether to use default pinned apps. -const char kUseDefaultPinnedApps[] = "use_default_pinned_apps"; -const char kPinnedLauncherApps[] = - "pinned_launcher_apps"; +const char kPinnedLauncherApps[] = "pinned_launcher_apps"; // Boolean value indicating whether to show a logout button in the ash tray. const char kShowLogoutButtonInTray[] = "show_logout_button_in_tray"; diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index db09c6dde12b..9cd9115e6439 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h @@ -757,7 +757,6 @@ extern const char kShelfAlignment[]; extern const char kShelfAlignmentLocal[]; extern const char kShelfAutoHideBehavior[]; extern const char kShelfAutoHideBehaviorLocal[]; -extern const char kUseDefaultPinnedApps[]; extern const char kPinnedLauncherApps[]; extern const char kShowLogoutButtonInTray[]; -- 2.11.4.GIT