Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2866)

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 270081: Facelifts to sync UI (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/new_new_tab.js ('k') | chrome/browser/sync/resources/gaia_login.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service.cc
===================================================================
--- chrome/browser/sync/profile_sync_service.cc (revision 29168)
+++ chrome/browser/sync/profile_sync_service.cc (working copy)
@@ -212,9 +212,9 @@
void ProfileSyncService::OnUnrecoverableError() {
unrecoverable_error_detected_ = true;
change_processor_->Stop();
-
- if (SetupInProgress())
- wizard_.Step(SyncSetupWizard::FATAL_ERROR);
+
+ // Tell the wizard so it can inform the user only if it is already open.
+ wizard_.Step(SyncSetupWizard::FATAL_ERROR);
FOR_EACH_OBSERVER(Observer, observers_, OnStateChanged());
LOG(ERROR) << "Unrecoverable error detected -- ProfileSyncService unusable.";
}
@@ -338,17 +338,19 @@
void ProfileSyncService::OnUserAcceptedMergeAndSync() {
base::TimeTicks start_time = base::TimeTicks::Now();
+ bool not_first_run = model_associator_->SyncModelHasUserCreatedNodes();
bool merge_success = model_associator_->AssociateModels();
UMA_HISTOGRAM_MEDIUM_TIMES("Sync.UserPerceivedBookmarkAssociation",
base::TimeTicks::Now() - start_time);
-
- wizard_.Step(SyncSetupWizard::DONE); // TODO(timsteele): error state?
if (!merge_success) {
LOG(ERROR) << "Model assocation failed.";
OnUnrecoverableError();
return;
}
+ wizard_.Step(not_first_run ? SyncSetupWizard::DONE :
+ SyncSetupWizard::DONE_FIRST_TIME);
+
change_processor_->Start(profile_->GetBookmarkModel(),
backend_->GetUserShareHandle());
FOR_EACH_OBSERVER(Observer, observers_, OnStateChanged());
@@ -385,17 +387,19 @@
// We're ready to merge the models.
base::TimeTicks start_time = base::TimeTicks::Now();
+ bool not_first_run = model_associator_->SyncModelHasUserCreatedNodes();
bool merge_success = model_associator_->AssociateModels();
UMA_HISTOGRAM_TIMES("Sync.BookmarkAssociationTime",
base::TimeTicks::Now() - start_time);
-
- wizard_.Step(SyncSetupWizard::DONE); // TODO(timsteele): error state?
if (!merge_success) {
- LOG(ERROR) << "Model assocation failed.";
- OnUnrecoverableError();
- return;
+ LOG(ERROR) << "Model assocation failed.";
+ OnUnrecoverableError();
+ return;
}
+ wizard_.Step(not_first_run ? SyncSetupWizard::DONE :
+ SyncSetupWizard::DONE_FIRST_TIME);
+
change_processor_->Start(profile_->GetBookmarkModel(),
backend_->GetUserShareHandle());
FOR_EACH_OBSERVER(Observer, observers_, OnStateChanged());
« no previous file with comments | « chrome/browser/resources/new_new_tab.js ('k') | chrome/browser/sync/resources/gaia_login.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698