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

Unified Diff: chrome/browser/ui/webui/ntp/foreign_session_handler.cc

Issue 10834351: [sync] Divorce DataTypeManager from NotificationService notifications by creating a new DataTypeMa… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restore expectations in DTMImpl unittest + Treat observer_ as const Created 8 years, 4 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/test_profile_sync_service.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/foreign_session_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/foreign_session_handler.cc b/chrome/browser/ui/webui/ntp/foreign_session_handler.cc
index 1e2066664aec9210969c2be454545a43d0f92c4e..fbcade5defbf8acb56288915ef1770530913c1f8 100644
--- a/chrome/browser/ui/webui/ntp/foreign_session_handler.cc
+++ b/chrome/browser/ui/webui/ntp/foreign_session_handler.cc
@@ -74,12 +74,11 @@ void ForeignSessionHandler::RegisterMessages() {
}
void ForeignSessionHandler::Init() {
- // TODO(dubroy): Change this to only observe this notification on the current
- // profile, rather than all sources (crbug.com/124717).
- registrar_.Add(this, chrome::NOTIFICATION_SYNC_CONFIGURE_DONE,
- content::NotificationService::AllSources());
-
Profile* profile = Profile::FromWebUI(web_ui());
+ ProfileSyncService* service =
+ ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile);
+ registrar_.Add(this, chrome::NOTIFICATION_SYNC_CONFIGURE_DONE,
+ content::Source<ProfileSyncService>(service));
registrar_.Add(this, chrome::NOTIFICATION_FOREIGN_SESSION_UPDATED,
content::Source<Profile>(profile));
registrar_.Add(this, chrome::NOTIFICATION_FOREIGN_SESSION_DISABLED,
« no previous file with comments | « chrome/browser/sync/test_profile_sync_service.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698