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

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

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/sync/profile_sync_service.h ('k') | chrome/browser/ui/webui/foreign_session_handler.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 58b84e9e2ca9c2bd5757a4f0a0b41399c7babf3e..f35dc9b029401392790987564db0fdbd08ff818d 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -27,6 +27,7 @@
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/browser/browsing_data/browsing_data_helper.h"
+#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/invalidation/profile_invalidation_provider_factory.h"
#include "chrome/browser/password_manager/password_store_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -69,6 +70,9 @@
#include "components/syncable_prefs/pref_service_syncable.h"
#include "components/version_info/version_info_values.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/notification_details.h"
+#include "content/public/browser/notification_service.h"
+#include "content/public/browser/notification_source.h"
#include "net/cookies/cookie_monster.h"
#include "net/url_request/url_request_context_getter.h"
#include "sync/api/sync_error.h"
@@ -263,6 +267,9 @@ ProfileSyncService::ProfileSyncService(
local_device_->GetSyncUserAgent(),
profile_->GetRequestContext(),
browser_sync::SyncStoppedReporter::ResultCallback()));
+
+ registrar_.Add(this, chrome::NOTIFICATION_FOREIGN_SESSION_UPDATED,
+ content::Source<Profile>(profile));
sessions_sync_manager_.reset(
new SessionsSyncManager(sync_client_->GetSyncSessionsClient(), profile,
local_device_.get(), router.Pass()));
@@ -910,6 +917,14 @@ void ProfileSyncService::ShutdownImpl(syncer::ShutdownReason reason) {
sync_prefs_.SetCleanShutdown(true);
}
+void ProfileSyncService::Observe(
+ int type, const content::NotificationSource& source,
+ const content::NotificationDetails& details) {
+ DCHECK_EQ(chrome::NOTIFICATION_FOREIGN_SESSION_UPDATED, type);
+ FOR_EACH_OBSERVER(sync_driver::SyncServiceObserver, observers_,
+ OnForeignSessionUpdated());
+}
+
void ProfileSyncService::StopImpl(SyncStopDataFate data_fate) {
switch (data_fate) {
case KEEP_DATA:
« no previous file with comments | « chrome/browser/sync/profile_sync_service.h ('k') | chrome/browser/ui/webui/foreign_session_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698