Index: components/sync_sessions/task_tracker.h |
diff --git a/components/sync_sessions/task_tracker.h b/components/sync_sessions/task_tracker.h |
index 44ee36368a6f879822bf5f8a15dc8cb2878d9d02..3d0e780217c8abba3aff0b078594ce207af699c0 100644 |
--- a/components/sync_sessions/task_tracker.h |
+++ b/components/sync_sessions/task_tracker.h |
@@ -29,10 +29,10 @@ namespace sync_sessions { |
// TODO(shenchao): If the tab is restored, then the input navigation is not |
// necessarily the first navigation in this case. Need to fix it by initalizing |
// the object with restored data. |
-// TODO(shenchao): Support to track tasks cross tabs. |
class TabTasks { |
public: |
TabTasks(); |
+ explicit TabTasks(const TabTasks* source_tab); |
virtual ~TabTasks(); |
// Gets top-down task id list of ancestors and itself for |
@@ -67,6 +67,8 @@ class TabTasks { |
// Task ids (with root task) for the navigations of the tab. The vector is |
// corresponding to the sequence of navigations of the tab. |
std::vector<TaskIdAndRoot> task_ids_; |
+ // Task ids from the source tab. |
+ std::vector<int64_t> source_tab_task_ids_; |
Nicolas Zea
2017/05/10 00:10:56
Why store the source tab task in a separate vector
shenchao
2017/05/17 16:48:16
Done.
|
// Index of current navigation in task_ids_. |
int current_navigation_index_ = -1; |
// Number of oldest ancestors which have been excluded from being tracked in |
@@ -87,6 +89,11 @@ class TaskTracker { |
// given |tab_id|. |
TabTasks* GetTabTasks(SessionID::id_type tab_id); |
+ // Returns a TabTasks pointer, which is owned by this object, for the tab of |
+ // given |tab_id|, which is created from a source tab |source_tab_id|. |
+ TabTasks* GetTabTasks(SessionID::id_type tab_id, |
+ SessionID::id_type source_tab_id); |
+ |
// Cleans tracked task ids of navigations in the tab of |tab_id|. |
void CleanTabTasks(SessionID::id_type tab_id); |