From c530082e7261d5190b8a2b455773c41f35366dfa Mon Sep 17 00:00:00 2001 From: "xiyuan@chromium.org" Date: Fri, 21 Sep 2012 04:49:47 +0000 Subject: cros: Run sync animation for new users only. BUG=150679 TEST=Verify sync animation only runs when user logs into device for the first time. R=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/10960017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157926 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/ui/ash/chrome_launcher_prefs.cc | 3 +++ chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc | 5 ++++- chrome/common/pref_names.cc | 7 +++++++ chrome/common/pref_names.h | 2 ++ 4 files changed, 16 insertions(+), 1 deletion(-) (limited to 'chrome') diff --git a/chrome/browser/ui/ash/chrome_launcher_prefs.cc b/chrome/browser/ui/ash/chrome_launcher_prefs.cc index ba4e097..5769056 100644 --- a/chrome/browser/ui/ash/chrome_launcher_prefs.cc +++ b/chrome/browser/ui/ash/chrome_launcher_prefs.cc @@ -57,6 +57,9 @@ void RegisterChromeLauncherUserPrefs(PrefService* user_prefs) { user_prefs->RegisterStringPref(prefs::kShelfAlignment, kShelfAlignmentBottom, PrefService::SYNCABLE_PREF); + user_prefs->RegisterBooleanPref(prefs::kLauncherShouldRunSyncAnimation, + true, + PrefService::UNSYNCABLE_PREF); } base::DictionaryValue* CreateAppDict(const std::string& app_id) { diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc index 040810c..db97d8b 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc @@ -123,7 +123,10 @@ ChromeLauncherController::ChromeLauncherController(Profile* profile, profile_ = ProfileManager::GetDefaultProfile()->GetOriginalProfile(); // Monitor app sync on chromeos. - if (!IsLoggedInAsGuest()) { + PrefService* prefs = profile_->GetPrefs(); + if (!IsLoggedInAsGuest() && + prefs->GetBoolean(prefs::kLauncherShouldRunSyncAnimation)) { + prefs->SetBoolean(prefs::kLauncherShouldRunSyncAnimation, false); observed_sync_service_ = ProfileSyncServiceFactory::GetForProfile(profile_); if (observed_sync_service_) diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index 51d6c1e..62f3a03 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -1994,6 +1994,13 @@ const char kUseDefaultPinnedApps[] = "use_default_pinned_apps"; const char kPinnedLauncherApps[] = "pinned_launcher_apps"; +// Boolean value indicating whether launcher should run sync animation. +// Note this is an unsyncable pref value used as a flag per profile because sync +// animation should only run once for new ChromeOS login (i.e. once per created +// profile on ChromeOS device). +const char kLauncherShouldRunSyncAnimation[] = + "launcher_should_run_sync_animation"; + const char kLongPressTimeInSeconds[] = "gesture.long_press_time_in_seconds"; const char kMaxDistanceBetweenTapsForDoubleTap[] = diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index 1342251..02bdd15 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h @@ -722,6 +722,8 @@ extern const char kShelfAutoHideBehavior[]; extern const char kUseDefaultPinnedApps[]; extern const char kPinnedLauncherApps[]; +extern const char kLauncherShouldRunSyncAnimation[]; + extern const char kLongPressTimeInSeconds[]; extern const char kMaxDistanceBetweenTapsForDoubleTap[]; extern const char kMaxDistanceForTwoFingerTapInPixels[]; -- cgit v1.1