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

Side by Side Diff: components/sync_sessions/sessions_sync_manager.h

Issue 2776633003: Add taskid for navigation, created in session sync (Closed)
Patch Set: Add taskids for navigation, created in session sync. Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « components/sync_sessions/BUILD.gn ('k') | components/sync_sessions/sessions_sync_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 of |tab_delegate|, and fills
243 // TabNavigation's task id related fields in |specifics|.
244 void TrackTasks(SyncedTabDelegate* const tab_delegate,
245 sync_pb::SessionSpecifics* specifics);
246
241 // It's possible that when we associate windows, tabs aren't all loaded 247 // 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 248 // 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 249 // 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 250 // 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 251 // 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. 252 // ID and window ID (from our TabNodePool) and updates them if either differs.
247 void AssociateRestoredPlaceholderTab( 253 void AssociateRestoredPlaceholderTab(
248 const SyncedTabDelegate& tab_delegate, 254 const SyncedTabDelegate& tab_delegate,
249 SessionID::id_type new_tab_id, 255 SessionID::id_type new_tab_id,
250 SessionID::id_type new_window_id, 256 SessionID::id_type new_window_id,
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 322
317 std::unique_ptr<sync_sessions::LostNavigationsRecorder> 323 std::unique_ptr<sync_sessions::LostNavigationsRecorder>
318 lost_navigations_recorder_; 324 lost_navigations_recorder_;
319 325
320 // Callback to inform interested observer that new sessions data has arrived. 326 // Callback to inform interested observer that new sessions data has arrived.
321 base::Closure sessions_updated_callback_; 327 base::Closure sessions_updated_callback_;
322 328
323 // Callback to inform sync that a sync data refresh is requested. 329 // Callback to inform sync that a sync data refresh is requested.
324 base::Closure datatype_refresh_callback_; 330 base::Closure datatype_refresh_callback_;
325 331
332 // Tracks Chrome Tasks, which associates navigations, with tab and navigation
333 // changes of current session.
334 std::unique_ptr<TaskTracker> task_tracker_;
335
326 DISALLOW_COPY_AND_ASSIGN(SessionsSyncManager); 336 DISALLOW_COPY_AND_ASSIGN(SessionsSyncManager);
327 }; 337 };
328 338
329 } // namespace sync_sessions 339 } // namespace sync_sessions
330 340
331 #endif // COMPONENTS_SYNC_SESSIONS_SESSIONS_SYNC_MANAGER_H_ 341 #endif // COMPONENTS_SYNC_SESSIONS_SESSIONS_SYNC_MANAGER_H_
OLDNEW
« no previous file with comments | « components/sync_sessions/BUILD.gn ('k') | components/sync_sessions/sessions_sync_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698