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

Unified Diff: chrome/browser/sync/glue/synced_session.h

Issue 7966020: [Sync] Fix Session's handling of windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits, rebase. Created 9 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
Index: chrome/browser/sync/glue/synced_session.h
diff --git a/chrome/browser/sync/glue/synced_session.h b/chrome/browser/sync/glue/synced_session.h
index 00f956b9be79c900ec746fa40be37e7f9420a764..80d9489a2c8adbf43e697d719f940d9b4145be7a 100644
--- a/chrome/browser/sync/glue/synced_session.h
+++ b/chrome/browser/sync/glue/synced_session.h
@@ -6,9 +6,12 @@
#define CHROME_BROWSER_SYNC_GLUE_SYNCED_SESSION_H_
#pragma once
+#include <map>
#include <string>
-#include <vector>
+#include "chrome/browser/sessions/session_id.h"
+
+struct SessionTab;
struct SessionWindow;
namespace browser_sync {
@@ -17,6 +20,8 @@ namespace browser_sync {
// list of windows along with a unique session identifer (tag) and meta-data
// about the device being synced.
struct SyncedSession {
+ typedef std::map<SessionID::id_type, SessionWindow*> SyncedWindowMap;
+
// The type of device.
enum DeviceType {
TYPE_UNSET = 0,
@@ -34,10 +39,27 @@ struct SyncedSession {
std::string session_tag;
// User-visible name
std::string session_name;
+
+ // Type of device this session is from.
DeviceType device_type;
- std::vector<SessionWindow*> windows;
+
+ // Map of windows that make up this session. Windowws are owned by the session
+ // itself and free'd on destruction.
+ SyncedWindowMap windows;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SyncedSession);
};
+// Control which foreign tabs we're interested in syncing/displaying. Checks
+// that the tab has navigations and is not a new tab (url == NTP).
+// Note: A new tab page with back/forward history is valid.
+bool IsValidSessionTab(const SessionTab& tab);
+
+// Checks whether the window has tabs to sync. If no tabs to sync, it returns
+// true, false otherwise.
+bool SessionWindowHasNoTabsToSync(const SessionWindow& window);
+
} // namespace browser_sync
#endif // CHROME_BROWSER_SYNC_GLUE_SYNCED_SESSION_H_
« no previous file with comments | « chrome/browser/sync/glue/session_model_associator_unittest.cc ('k') | chrome/browser/sync/glue/synced_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698