OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_SYNC_SESSIONS_SESSIONS_SYNC_MANAGER_H_ | 5 #ifndef COMPONENTS_SYNC_SESSIONS_SESSIONS_SYNC_MANAGER_H_ |
6 #define COMPONENTS_SYNC_SESSIONS_SESSIONS_SYNC_MANAGER_H_ | 6 #define COMPONENTS_SYNC_SESSIONS_SESSIONS_SYNC_MANAGER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "components/sync/base/sync_prefs.h" | 23 #include "components/sync/base/sync_prefs.h" |
24 #include "components/sync/device_info/device_info.h" | 24 #include "components/sync/device_info/device_info.h" |
25 #include "components/sync/model/syncable_service.h" | 25 #include "components/sync/model/syncable_service.h" |
26 #include "components/sync_sessions/favicon_cache.h" | 26 #include "components/sync_sessions/favicon_cache.h" |
27 #include "components/sync_sessions/local_session_event_router.h" | 27 #include "components/sync_sessions/local_session_event_router.h" |
28 #include "components/sync_sessions/lost_navigations_recorder.h" | 28 #include "components/sync_sessions/lost_navigations_recorder.h" |
29 #include "components/sync_sessions/open_tabs_ui_delegate.h" | 29 #include "components/sync_sessions/open_tabs_ui_delegate.h" |
30 #include "components/sync_sessions/revisit/page_revisit_broadcaster.h" | 30 #include "components/sync_sessions/revisit/page_revisit_broadcaster.h" |
31 #include "components/sync_sessions/synced_session.h" | 31 #include "components/sync_sessions/synced_session.h" |
32 #include "components/sync_sessions/synced_session_tracker.h" | 32 #include "components/sync_sessions/synced_session_tracker.h" |
| 33 #include "components/sync_sessions/task_tracker.h" |
33 | 34 |
34 namespace syncer { | 35 namespace syncer { |
35 class LocalDeviceInfoProvider; | 36 class LocalDeviceInfoProvider; |
36 class SyncErrorFactory; | 37 class SyncErrorFactory; |
37 class SyncPrefs; | 38 class SyncPrefs; |
38 } // namespace syncer | 39 } // namespace syncer |
39 | 40 |
40 namespace sync_pb { | 41 namespace sync_pb { |
41 class SessionHeader; | 42 class SessionHeader; |
42 class SessionSpecifics; | 43 class SessionSpecifics; |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 sessions::SessionTab* session_tab); | 232 sessions::SessionTab* session_tab); |
232 | 233 |
233 // Sets |variation_ids| field of |session_tab| with the ids of the currently | 234 // Sets |variation_ids| field of |session_tab| with the ids of the currently |
234 // assigned variations which should be sent to sync. | 235 // assigned variations which should be sent to sync. |
235 static void SetVariationIds(sessions::SessionTab* session_tab); | 236 static void SetVariationIds(sessions::SessionTab* session_tab); |
236 | 237 |
237 // Populates |specifics| based on the data in |tab_delegate|. | 238 // Populates |specifics| based on the data in |tab_delegate|. |
238 void LocalTabDelegateToSpecifics(const SyncedTabDelegate& tab_delegate, | 239 void LocalTabDelegateToSpecifics(const SyncedTabDelegate& tab_delegate, |
239 sync_pb::SessionSpecifics* specifics); | 240 sync_pb::SessionSpecifics* specifics); |
240 | 241 |
| 242 // Updates task tracker with current navigation, and fills TabNavigation's |
| 243 // task id related fields in |specifics|. |
| 244 void TrackTasks(SessionID::id_type tab_id, |
| 245 SyncedTabDelegate* const tab_delegate, |
| 246 sync_pb::SessionSpecifics* specifics); |
| 247 |
241 // It's possible that when we associate windows, tabs aren't all loaded | 248 // It's possible that when we associate windows, tabs aren't all loaded |
242 // into memory yet (e.g on android) and we don't have a WebContents. In this | 249 // into memory yet (e.g on android) and we don't have a WebContents. In this |
243 // case we can't do a full association, but we still want to update tab IDs | 250 // case we can't do a full association, but we still want to update tab IDs |
244 // as they may have changed after a session was restored. This method | 251 // as they may have changed after a session was restored. This method |
245 // compares new_tab_id and new_window_id against the previously persisted tab | 252 // compares new_tab_id and new_window_id against the previously persisted tab |
246 // ID and window ID (from our TabNodePool) and updates them if either differs. | 253 // ID and window ID (from our TabNodePool) and updates them if either differs. |
247 void AssociateRestoredPlaceholderTab( | 254 void AssociateRestoredPlaceholderTab( |
248 const SyncedTabDelegate& tab_delegate, | 255 const SyncedTabDelegate& tab_delegate, |
249 SessionID::id_type new_tab_id, | 256 SessionID::id_type new_tab_id, |
250 SessionID::id_type new_window_id, | 257 SessionID::id_type new_window_id, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 323 |
317 std::unique_ptr<sync_sessions::LostNavigationsRecorder> | 324 std::unique_ptr<sync_sessions::LostNavigationsRecorder> |
318 lost_navigations_recorder_; | 325 lost_navigations_recorder_; |
319 | 326 |
320 // Callback to inform interested observer that new sessions data has arrived. | 327 // Callback to inform interested observer that new sessions data has arrived. |
321 base::Closure sessions_updated_callback_; | 328 base::Closure sessions_updated_callback_; |
322 | 329 |
323 // Callback to inform sync that a sync data refresh is requested. | 330 // Callback to inform sync that a sync data refresh is requested. |
324 base::Closure datatype_refresh_callback_; | 331 base::Closure datatype_refresh_callback_; |
325 | 332 |
| 333 // Tracks Chrome Tasks, which associates navigations, with tab and navigation |
| 334 // changes of current session. |
| 335 std::unique_ptr<TaskTracker> task_tracker_; |
| 336 |
326 DISALLOW_COPY_AND_ASSIGN(SessionsSyncManager); | 337 DISALLOW_COPY_AND_ASSIGN(SessionsSyncManager); |
327 }; | 338 }; |
328 | 339 |
329 } // namespace sync_sessions | 340 } // namespace sync_sessions |
330 | 341 |
331 #endif // COMPONENTS_SYNC_SESSIONS_SESSIONS_SYNC_MANAGER_H_ | 342 #endif // COMPONENTS_SYNC_SESSIONS_SESSIONS_SYNC_MANAGER_H_ |
OLD | NEW |