summaryrefslogtreecommitdiffstats
path: root/components/sync_driver
diff options
context:
space:
mode:
authorzea <zea@chromium.org>2015-08-04 16:20:27 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-04 23:21:52 +0000
commite8f0c131d9376781a7fc21dec7228e7c2790390f (patch)
tree21f8ef7cb0fe863e649465d73b9d5d83b862c0ed /components/sync_driver
parent0bb69c7f9ab18c6e79dd607ee6ab405231964dac (diff)
downloadchromium_src-e8f0c131d9376781a7fc21dec7228e7c2790390f.zip
chromium_src-e8f0c131d9376781a7fc21dec7228e7c2790390f.tar.gz
chromium_src-e8f0c131d9376781a7fc21dec7228e7c2790390f.tar.bz2
[Sync] Add support for ordering tab sync tabs by recency
Updates the Desktop and Android logic to sort tabs by recency (behind the TabSyncByRecency finch experiment). IOS is still a todo. BUG=500080 Review URL: https://codereview.chromium.org/1244623004 Cr-Commit-Position: refs/heads/master@{#341821}
Diffstat (limited to 'components/sync_driver')
-rw-r--r--components/sync_driver/open_tabs_ui_delegate.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/components/sync_driver/open_tabs_ui_delegate.h b/components/sync_driver/open_tabs_ui_delegate.h
index 0bc5e70..f153eb6 100644
--- a/components/sync_driver/open_tabs_ui_delegate.h
+++ b/components/sync_driver/open_tabs_ui_delegate.h
@@ -25,8 +25,8 @@ class OpenTabsUIDelegate {
const std::string& pageurl,
scoped_refptr<base::RefCountedMemory>* favicon_png) const = 0;
- // Builds a list of all foreign sessions. Caller does NOT own SyncedSession
- // objects.
+ // Builds a list of all foreign sessions, ordered from most recent to least
+ // recent. Caller does NOT own SyncedSession objects.
// Returns true if foreign sessions were found, false otherwise.
virtual bool GetAllForeignSessions(
std::vector<const SyncedSession*>* sessions) = 0;
@@ -42,12 +42,21 @@ class OpenTabsUIDelegate {
virtual void DeleteForeignSession(const std::string& tag) = 0;
// Loads all windows for foreign session with session tag |tag|. Caller does
- // NOT own SyncedSession objects.
+ // NOT own SessionWindow objects.
// Returns true if the foreign session was found, false otherwise.
virtual bool GetForeignSession(
const std::string& tag,
std::vector<const sessions::SessionWindow*>* windows) = 0;
+ // Loads all tabs for a foreign session, ignoring window grouping, and
+ // ordering by recency (most recent to least recent). Will automatically
+ // prune those tabs that are not syncable or are the NTP. Caller does NOT own
+ // SessionTab objects.
+ // Returns true if the foreign session was found, false otherwise.
+ virtual bool GetForeignSessionTabs(
+ const std::string& tag,
+ std::vector<const sessions::SessionTab*>* tabs) = 0;
+
// Sets |*local| to point to the sessions sync representation of the
// local machine.
virtual bool GetLocalSession(const SyncedSession** local) = 0;