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

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

Issue 1406943004: [sync] Isolate FOREIGN_SESSION_UPDATED notification in ProfileSyncService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/android/foreign_session_helper.cc ('k') | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service.h
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index 3309efd6e87fcb9a315c1d681d28619c49b09802..c82f4c05c4695d98a9386ae9ac332bdc7470340f 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -39,6 +39,8 @@
#include "components/sync_driver/sync_prefs.h"
#include "components/sync_driver/sync_service.h"
#include "components/sync_driver/sync_stopped_reporter.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
#include "google_apis/gaia/google_service_auth_error.h"
#include "google_apis/gaia/oauth2_token_service.h"
#include "net/base/backoff_entry.h"
@@ -178,6 +180,7 @@ class ProfileSyncService : public sync_driver::SyncService,
public sync_driver::DataTypeManagerObserver,
public syncer::UnrecoverableErrorHandler,
public KeyedService,
+ public content::NotificationObserver,
public OAuth2TokenService::Consumer,
public OAuth2TokenService::Observer,
public SigninManagerBase::Observer {
@@ -641,6 +644,11 @@ class ProfileSyncService : public sync_driver::SyncService,
friend class TestProfileSyncService;
FRIEND_TEST_ALL_PREFIXES(ProfileSyncServiceTest, InitialState);
+ // Observe notifications.
+ void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) override;
+
// Stops the sync engine. Does NOT set IsSyncRequested to false. Use
// RequestStop for that. |data_fate| controls whether the local sync data is
// deleted or kept when the engine shuts down.
@@ -981,6 +989,8 @@ class ProfileSyncService : public sync_driver::SyncService,
// IsPassphrasePrompted sync preference.
bool passphrase_prompt_triggered_by_version_;
+ content::NotificationRegistrar registrar_;
+
base::WeakPtrFactory<ProfileSyncService> weak_factory_;
// We don't use |weak_factory_| for the StartupController because the weak
« no previous file with comments | « chrome/browser/android/foreign_session_helper.cc ('k') | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698