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

Unified Diff: chrome/browser/sessions/session_types.h

Issue 10990012: [Sync] Refactor handling of session tabs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Few more fixes Created 8 years, 3 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/sessions/session_types.h
diff --git a/chrome/browser/sessions/session_types.h b/chrome/browser/sessions/session_types.h
index dc9c7baec09059d4140d93628837695238a1abe5..bb0ee1b7109b68553139b0c2817b9ab859bc6abe 100644
--- a/chrome/browser/sessions/session_types.h
+++ b/chrome/browser/sessions/session_types.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_SESSIONS_SESSION_TYPES_H_
#define CHROME_BROWSER_SESSIONS_SESSION_TYPES_H_
+#include <algorithm>
#include <string>
#include <vector>
@@ -58,7 +59,7 @@ class TabNavigation {
// contain all TabNavigation fields.
static TabNavigation FromSyncData(
int index,
- const sync_pb::TabNavigation& specifics);
+ const sync_pb::TabNavigation& sync_data);
// Note that not all TabNavigation fields are preserved.
void WriteToPickle(Pickle* pickle) const;
@@ -130,7 +131,7 @@ class TabNavigation {
// SessionTab corresponds to a NavigationController.
struct SessionTab {
SessionTab();
- virtual ~SessionTab();
+ ~SessionTab();
// Since the current_navigation_index can be larger than the index for number
// of navigations in the current sessions (chrome://newtab is not stored), we
@@ -141,6 +142,20 @@ struct SessionTab {
static_cast<int>(navigations.size() - 1)));
}
+ // Set all the fields of this object from the given sync data and
+ // timestamp. Uses TabNavigation::FromSyncData to fill
+ // |navigations|. Note that the sync protocol buffer doesn't
+ // contain all TabNavigation fields.
+ void SetFromSyncData(const sync_pb::SessionTab& sync_data,
+ base::Time timestamp);
+
+ // Convert this object into its sync protocol buffer equivalent.
+ // Uses TabNavigation::ToSyncData to convert |navigations|. Note
+ // that the protocol buffer doesn't contain all TabNavigation
+ // fields, and that the returned protocol buffer doesn't have any
+ // favicon data.
+ sync_pb::SessionTab ToSyncData() const;
+
// Unique id of the window.
SessionID window_id;
« no previous file with comments | « no previous file | chrome/browser/sessions/session_types.cc » ('j') | chrome/browser/sync/glue/session_model_associator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698