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

Unified Diff: chrome/browser/sync/glue/sync_backend_host.cc

Issue 8295017: [Sync] Support open tabs experiment enabling before sync setup completion. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactor Created 9 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
Index: chrome/browser/sync/glue/sync_backend_host.cc
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc
index 1c4368308e5d4856eeba271ceeed24d18a9b4758..0534770807fa602d8307738647453cb49f1543e6 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -819,11 +819,8 @@ void SyncBackendHost::Core::HandleSyncCycleCompletedOnFrontendLoop(
// Process any changes to the datatypes we're syncing.
// TODO(sync): add support for removing types.
- syncable::ModelTypeSet to_add;
- if (host_->initialized() &&
- sync_manager()->ReceivedExperimentalTypes(&to_add)) {
- host_->frontend_->OnDataTypesChanged(to_add);
- }
+ if (host_->initialized())
+ host_->AddExperimentalTypes();
// If we are waiting for a configuration change, check here to see
// if this sync cycle has initialized all of the types we've been
@@ -874,6 +871,13 @@ void SyncBackendHost::Core::FinishConfigureDataTypesOnFrontendLoop() {
host_->FinishConfigureDataTypesOnFrontendLoop();
}
+void SyncBackendHost::AddExperimentalTypes() {
+ CHECK(initialized());
+ syncable::ModelTypeSet to_add;
+ if (core_->sync_manager()->ReceivedExperimentalTypes(&to_add))
+ frontend_->OnDataTypesChanged(to_add);
+}
+
void SyncBackendHost::HandleInitializationCompletedOnFrontendLoop(
const WeakHandle<JsBackend>& js_backend, bool success) {
DCHECK_NE(NOT_ATTEMPTED, initialization_state_);
@@ -924,6 +928,10 @@ void SyncBackendHost::HandleInitializationCompletedOnFrontendLoop(
break;
case REFRESHING_ENCRYPTION:
initialization_state_ = INITIALIZED;
+ // Now that we've downloaded the nigori node, we can see if there are any
+ // experimental types to enable. This should be done before we inform
+ // the frontend to ensure they're visible in the customize screen.
+ AddExperimentalTypes();
frontend_->OnBackendInitialized(js_backend, true);
// Now that we're fully initialized, kick off a server
// reachability check.

Powered by Google App Engine
This is Rietveld 408576698