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

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

Issue 10167001: Sync: Prevent delay in showing the Other Devices button after first sign-in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comment w/ link to bug for a follow-up CL. Created 8 years, 8 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 | no next file » | 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 525915052568ccc294e689dabf01db327e6504f0..04fe8bd268853add0d15069554fc73746e18cd76 100644
--- a/chrome/browser/ui/webui/ntp/foreign_session_handler.cc
+++ b/chrome/browser/ui/webui/ntp/foreign_session_handler.cc
@@ -62,9 +62,12 @@ void ForeignSessionHandler::RegisterMessages() {
}
void ForeignSessionHandler::Init() {
- Profile* profile = Profile::FromWebUI(web_ui());
+ // 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::Source<Profile>(profile));
+ content::NotificationService::AllSources());
+
+ Profile* profile = Profile::FromWebUI(web_ui());
registrar_.Add(this, chrome::NOTIFICATION_FOREIGN_SESSION_UPDATED,
content::Source<Profile>(profile));
registrar_.Add(this, chrome::NOTIFICATION_FOREIGN_SESSION_DISABLED,
@@ -106,7 +109,7 @@ bool ForeignSessionHandler::IsTabSyncEnabled() {
Profile* profile = Profile::FromWebUI(web_ui());
ProfileSyncService* service =
ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile);
- return service && service->GetSessionModelAssociator();
+ return service && service->GetPreferredDataTypes().Has(syncable::SESSIONS);
}
string16 ForeignSessionHandler::FormatSessionTime(const base::Time& time) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698