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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 // Contains all logic for associating the Chrome sessions model and | 56 // Contains all logic for associating the Chrome sessions model and |
57 // the sync sessions model. | 57 // the sync sessions model. |
58 class SessionsSyncManager : public syncer::SyncableService, | 58 class SessionsSyncManager : public syncer::SyncableService, |
59 public OpenTabsUIDelegate, | 59 public OpenTabsUIDelegate, |
60 public LocalSessionEventHandler { | 60 public LocalSessionEventHandler { |
61 public: | 61 public: |
62 SessionsSyncManager(SyncSessionsClient* sessions_client, | 62 SessionsSyncManager(SyncSessionsClient* sessions_client, |
63 syncer::SyncPrefs* sync_prefs, | 63 syncer::SyncPrefs* sync_prefs, |
64 syncer::LocalDeviceInfoProvider* local_device, | 64 syncer::LocalDeviceInfoProvider* local_device, |
65 std::unique_ptr<LocalSessionEventRouter> router, | 65 LocalSessionEventRouter* router, |
66 const base::Closure& sessions_updated_callback, | 66 const base::Closure& sessions_updated_callback, |
67 const base::Closure& datatype_refresh_callback); | 67 const base::Closure& datatype_refresh_callback); |
68 ~SessionsSyncManager() override; | 68 ~SessionsSyncManager() override; |
69 | 69 |
70 // syncer::SyncableService implementation. | 70 // syncer::SyncableService implementation. |
71 syncer::SyncMergeResult MergeDataAndStartSyncing( | 71 syncer::SyncMergeResult MergeDataAndStartSyncing( |
72 syncer::ModelType type, | 72 syncer::ModelType type, |
73 const syncer::SyncDataList& initial_sync_data, | 73 const syncer::SyncDataList& initial_sync_data, |
74 std::unique_ptr<syncer::SyncChangeProcessor> sync_processor, | 74 std::unique_ptr<syncer::SyncChangeProcessor> sync_processor, |
75 std::unique_ptr<syncer::SyncErrorFactory> error_handler) override; | 75 std::unique_ptr<syncer::SyncErrorFactory> error_handler) override; |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 sync_pb::SyncEnums::DeviceType current_device_type_; | 302 sync_pb::SyncEnums::DeviceType current_device_type_; |
303 | 303 |
304 // SyncID for the sync node containing all the window information for this | 304 // SyncID for the sync node containing all the window information for this |
305 // client. | 305 // client. |
306 int local_session_header_node_id_; | 306 int local_session_header_node_id_; |
307 | 307 |
308 // Number of days without activity after which we consider a session to be | 308 // Number of days without activity after which we consider a session to be |
309 // stale and a candidate for garbage collection. | 309 // stale and a candidate for garbage collection. |
310 int stale_session_threshold_days_; | 310 int stale_session_threshold_days_; |
311 | 311 |
312 std::unique_ptr<LocalSessionEventRouter> local_event_router_; | 312 LocalSessionEventRouter* local_event_router_; |
313 | 313 |
314 // Owns revisiting instrumentation logic for page visit events. | 314 // Owns revisiting instrumentation logic for page visit events. |
315 PageRevisitBroadcaster page_revisit_broadcaster_; | 315 PageRevisitBroadcaster page_revisit_broadcaster_; |
316 | 316 |
317 std::unique_ptr<sync_sessions::LostNavigationsRecorder> | 317 std::unique_ptr<sync_sessions::LostNavigationsRecorder> |
318 lost_navigations_recorder_; | 318 lost_navigations_recorder_; |
319 | 319 |
320 // Callback to inform interested observer that new sessions data has arrived. | 320 // Callback to inform interested observer that new sessions data has arrived. |
321 base::Closure sessions_updated_callback_; | 321 base::Closure sessions_updated_callback_; |
322 | 322 |
323 // Callback to inform sync that a sync data refresh is requested. | 323 // Callback to inform sync that a sync data refresh is requested. |
324 base::Closure datatype_refresh_callback_; | 324 base::Closure datatype_refresh_callback_; |
325 | 325 |
326 DISALLOW_COPY_AND_ASSIGN(SessionsSyncManager); | 326 DISALLOW_COPY_AND_ASSIGN(SessionsSyncManager); |
327 }; | 327 }; |
328 | 328 |
329 } // namespace sync_sessions | 329 } // namespace sync_sessions |
330 | 330 |
331 #endif // COMPONENTS_SYNC_SESSIONS_SESSIONS_SYNC_MANAGER_H_ | 331 #endif // COMPONENTS_SYNC_SESSIONS_SESSIONS_SYNC_MANAGER_H_ |
OLD | NEW |