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

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

Issue 10387158: Merge 136934 - Notify sync observers whenever preferred types change (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1132/src/
Patch Set: 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
===================================================================
--- chrome/browser/sync/profile_sync_service.cc (revision 137481)
+++ chrome/browser/sync/profile_sync_service.cc (working copy)
@@ -463,6 +463,10 @@
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();
}
@@ -1128,6 +1132,7 @@
failed_datatypes_handler_.OnUserChoseDatatypes();
ChangePreferredDataTypes(chosen_types);
AcknowledgeSyncedTypes();
+ NotifyObservers();
}
void ProfileSyncService::ChangePreferredDataTypes(
@@ -1193,6 +1198,9 @@
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(
@@ -1209,6 +1217,7 @@
// 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;
@@ -1390,11 +1399,11 @@
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