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

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

Issue 9838064: Add a sign-in promo message to the Other Devices menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address dbeam's comments. Created 8 years, 9 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
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 4a6bbaed1601a893c36c1a9f65c796fe3fc52ed2..4c5154d5bac9b9a0934ebd6666412072ca20e9d6 100644
--- a/chrome/browser/ui/webui/ntp/foreign_session_handler.cc
+++ b/chrome/browser/ui/webui/ntp/foreign_session_handler.cc
@@ -94,17 +94,11 @@ void ForeignSessionHandler::HandleGetForeignSessions(const ListValue* args) {
SessionModelAssociator* associator = GetModelAssociator();
std::vector<const SyncedSession*> sessions;
- if (associator == NULL) {
- // Called before associator created, exit.
+ // Exit if the associator is not created or there are no foreign sessions.
+ if (!associator ||!associator->GetAllForeignSessions(&sessions))
return;
- }
// Note: we don't own the SyncedSessions themselves.
- if (!associator->GetAllForeignSessions(&sessions)) {
- LOG(ERROR) << "ForeignSessionHandler failed to get session data from"
- "SessionModelAssociator.";
- return;
- }
int added_count = 0;
ListValue session_list;
for (std::vector<const SyncedSession*>::const_iterator i =

Powered by Google App Engine
This is Rietveld 408576698