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

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

Issue 10382071: Notify sync observers whenever preferred types change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review feedback. Created 8 years, 7 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 | « no previous file | chrome/browser/sync/profile_sync_service_harness.h » ('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
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index 3e81f9f4d293a787709f3584c1e0ca3f3d5dabc1..3e605140a87bf8b45e55ca13652eeb48fcf87be0 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -464,6 +464,10 @@ void ProfileSyncService::ShutdownImpl(bool sync_disabled) {
this,
chrome::NOTIFICATION_SYNC_CONFIGURE_DONE,
content::Source<DataTypeManager>(data_type_manager_.get()));
+ registrar_.Remove(
+ this,
+ chrome::NOTIFICATION_SYNC_CONFIGURE_BLOCKED,
+ content::Source<DataTypeManager>(data_type_manager_.get()));
data_type_manager_.reset();
}
@@ -1131,6 +1135,7 @@ void ProfileSyncService::OnUserChoseDatatypes(bool sync_everything,
failed_datatypes_handler_.OnUserChoseDatatypes();
ChangePreferredDataTypes(chosen_types);
AcknowledgeSyncedTypes();
+ NotifyObservers();
}
void ProfileSyncService::ChangePreferredDataTypes(
@@ -1196,6 +1201,9 @@ void ProfileSyncService::ConfigureDataTypeManager() {
registrar_.Add(this,
chrome::NOTIFICATION_SYNC_CONFIGURE_DONE,
content::Source<DataTypeManager>(data_type_manager_.get()));
+ registrar_.Add(this,
+ chrome::NOTIFICATION_SYNC_CONFIGURE_BLOCKED,
+ content::Source<DataTypeManager>(data_type_manager_.get()));
// We create the migrator at the same time.
migrator_.reset(
@@ -1212,6 +1220,7 @@ void ProfileSyncService::ConfigureDataTypeManager() {
// until we receive an OnPassphraseAccepted (which triggers a configure).
DVLOG(1) << "ProfileSyncService::ConfigureDataTypeManager bailing out "
<< "because a passphrase required";
+ NotifyObservers();
return;
}
sync_api::ConfigureReason reason = sync_api::CONFIGURE_REASON_UNKNOWN;
@@ -1393,11 +1402,11 @@ void ProfileSyncService::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
switch (type) {
- case chrome::NOTIFICATION_SYNC_CONFIGURE_START: {
+ case chrome::NOTIFICATION_SYNC_CONFIGURE_START:
+ case chrome::NOTIFICATION_SYNC_CONFIGURE_BLOCKED:
NotifyObservers();
// TODO(sync): Maybe toast?
break;
- }
case chrome::NOTIFICATION_SYNC_CONFIGURE_DONE: {
// We should have cleared our cached passphrase before we get here (in
// OnBackendInitialized()).
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service_harness.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698