diff options
author | zork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-11 22:27:00 +0000 |
---|---|---|
committer | zork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-11 22:27:00 +0000 |
commit | fc186cac9263f1bcabe8772f12d96107ed467553 (patch) | |
tree | 270b4a470be4fdf5d0ad4813e270871f2621ba84 /chrome/browser/sync | |
parent | 56869389fcb13ac325315ca74b9684109c7cd87c (diff) | |
download | chromium_src-fc186cac9263f1bcabe8772f12d96107ed467553.zip chromium_src-fc186cac9263f1bcabe8772f12d96107ed467553.tar.gz chromium_src-fc186cac9263f1bcabe8772f12d96107ed467553.tar.bz2 |
patch from issue 2023004:
Fix Chrome OS pre-initial-sync options messaging.
When you first logged in to Chrome OS, it used to say "your account is not set up to sync" until you downloaded the initial sync. Now it follows the regular sync signup flow where it's "account details are not yet entered" until the authentication happens, then it's "setup in progress" while downloading the initial download, then it's "your account is set up to sync."
BUG=maybe in chrome OS tracker?
TEST=build chrome OS. log in to chrome OS with a new account. Immediately check wrench->options->personal stuff. It should not say "your account is not set up to sync..."
Review URL: http://codereview.chromium.org/2046005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46969 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
5 files changed, 10 insertions, 5 deletions
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc index 10ec858..e4fb3d4 100644 --- a/chrome/browser/sync/profile_sync_service.cc +++ b/chrome/browser/sync/profile_sync_service.cc @@ -88,6 +88,7 @@ void ProfileSyncService::Initialize() { // profile,) then bootstrap it. StartUp(); profile()->GetPrefs()->SetBoolean(prefs::kSyncBootstrappedAuth, true); + FOR_EACH_OBSERVER(Observer, observers_, OnStateChanged()); } } else { StartUp(); @@ -585,6 +586,7 @@ void ProfileSyncService::Observe(NotificationType type, const NotificationDetails& details) { switch (type.value) { case NotificationType::SYNC_CONFIGURE_START: { + FOR_EACH_OBSERVER(Observer, observers_, OnStateChanged()); // TODO(sync): Maybe toast? break; } diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h index f021385..86e3673 100644 --- a/chrome/browser/sync/profile_sync_service.h +++ b/chrome/browser/sync/profile_sync_service.h @@ -174,7 +174,8 @@ class ProfileSyncService : public browser_sync::SyncFrontend, // occurred preventing the action. We make it the duty of ProfileSyncService // to open the dialog to easily ensure only one is ever showing. bool SetupInProgress() const { - return !HasSyncSetupCompleted() && WizardIsVisible(); + return !HasSyncSetupCompleted() && + (WizardIsVisible() || bootstrap_sync_authentication_); } bool WizardIsVisible() const { return wizard_.IsVisible(); diff --git a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc index 4ab3e12..ee5c4c2 100644 --- a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc @@ -179,6 +179,7 @@ class ProfileSyncServiceAutofillTest : public testing::Test { // State changes once for the backend init and once for startup done. EXPECT_CALL(observer_, OnStateChanged()). WillOnce(InvokeTask(task)). + WillOnce(Return()). WillOnce(QuitUIMessageLoop()); service_->RegisterDataTypeController(data_type_controller); service_->Initialize(); diff --git a/chrome/browser/sync/profile_sync_service_startup_unittest.cc b/chrome/browser/sync/profile_sync_service_startup_unittest.cc index 18815e6..ad51f7d 100644 --- a/chrome/browser/sync/profile_sync_service_startup_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_startup_unittest.cc @@ -96,7 +96,7 @@ TEST_F(ProfileSyncServiceStartupTest, SKIP_MACOSX(StartFirstTime)) { EXPECT_CALL(*data_type_manager, state()). WillOnce(Return(DataTypeManager::CONFIGURED)); EXPECT_CALL(*data_type_manager, Stop()).Times(1); - EXPECT_CALL(observer_, OnStateChanged()).Times(3); + EXPECT_CALL(observer_, OnStateChanged()).Times(4); service_->EnableForUser(); } @@ -107,7 +107,7 @@ TEST_F(ProfileSyncServiceStartupTest, SKIP_MACOSX(StartNormal)) { WillOnce(Return(DataTypeManager::CONFIGURED)); EXPECT_CALL(*data_type_manager, Stop()).Times(1); - EXPECT_CALL(observer_, OnStateChanged()).Times(2); + EXPECT_CALL(observer_, OnStateChanged()).Times(3); service_->Initialize(); } @@ -124,7 +124,7 @@ TEST_F(ProfileSyncServiceStartupTest, SKIP_MACOSX(StartFailure)) { EXPECT_CALL(*data_type_manager, state()). WillOnce(Return(DataTypeManager::STOPPED)); - EXPECT_CALL(observer_, OnStateChanged()).Times(2); + EXPECT_CALL(observer_, OnStateChanged()).Times(3); service_->Initialize(); EXPECT_TRUE(service_->unrecoverable_error_detected()); @@ -148,7 +148,7 @@ TEST_F(ProfileSyncServiceStartupBootstrapTest, SKIP_MACOSX(StartFirstTime)) { EXPECT_CALL(*data_type_manager, state()). WillOnce(Return(DataTypeManager::CONFIGURED)); EXPECT_CALL(*data_type_manager, Stop()).Times(1); - EXPECT_CALL(observer_, OnStateChanged()).Times(3); + EXPECT_CALL(observer_, OnStateChanged()).Times(5); profile_.GetPrefs()->ClearPref(prefs::kSyncHasSetupCompleted); // Will start sync even though setup hasn't been completed (since diff --git a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc index 13995db..2872cf6 100644 --- a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc @@ -175,6 +175,7 @@ class ProfileSyncServiceTypedUrlTest : public testing::Test { // State changes once for the backend init and once for startup done. EXPECT_CALL(observer_, OnStateChanged()). WillOnce(InvokeTask(task)). + WillOnce(Return()). WillOnce(QuitUIMessageLoop()); service_->RegisterDataTypeController(data_type_controller); service_->Initialize(); |