| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_SYNC_GLUE_SESSION_MODEL_ASSOCIATOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_SESSION_MODEL_ASSOCIATOR_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_SESSION_MODEL_ASSOCIATOR_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_SESSION_MODEL_ASSOCIATOR_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 class ProfileSyncService; | 37 class ProfileSyncService; |
| 38 | 38 |
| 39 namespace content { | 39 namespace content { |
| 40 class NavigationEntry; | 40 class NavigationEntry; |
| 41 } // namespace content | 41 } // namespace content |
| 42 | 42 |
| 43 namespace syncer { | 43 namespace syncer { |
| 44 class BaseTransaction; | 44 class BaseTransaction; |
| 45 class ReadNode; | 45 class ReadNode; |
| 46 class WriteTransaction; | 46 class WriteTransaction; |
| 47 struct UserShare; |
| 47 } // namespace syncer | 48 } // namespace syncer |
| 48 | 49 |
| 49 namespace sync_pb { | 50 namespace sync_pb { |
| 50 class SessionHeader; | 51 class SessionHeader; |
| 51 class SessionSpecifics; | 52 class SessionSpecifics; |
| 52 class SessionTab; | 53 class SessionTab; |
| 53 class SessionWindow; | 54 class SessionWindow; |
| 54 class TabNavigation; | 55 class TabNavigation; |
| 55 } // namespace sync_pb | 56 } // namespace sync_pb |
| 56 | 57 |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 static bool ShouldSyncWindow(const SyncedWindowDelegate* window); | 381 static bool ShouldSyncWindow(const SyncedWindowDelegate* window); |
| 381 | 382 |
| 382 // Build a sync tag from tab_node_id. | 383 // Build a sync tag from tab_node_id. |
| 383 static std::string TabIdToTag( | 384 static std::string TabIdToTag( |
| 384 const std::string machine_tag, | 385 const std::string machine_tag, |
| 385 size_t tab_node_id) { | 386 size_t tab_node_id) { |
| 386 return base::StringPrintf("%s %"PRIuS"", machine_tag.c_str(), tab_node_id); | 387 return base::StringPrintf("%s %"PRIuS"", machine_tag.c_str(), tab_node_id); |
| 387 } | 388 } |
| 388 | 389 |
| 389 // Initializes the tag corresponding to this machine. | 390 // Initializes the tag corresponding to this machine. |
| 390 void InitializeCurrentMachineTag(syncer::WriteTransaction* trans); | 391 void InitializeCurrentMachineTag(syncer::UserShare* share); |
| 391 | 392 |
| 392 // Initializes the user visible name for this session | 393 // Initializes the user visible name for this session |
| 393 void InitializeCurrentSessionName(); | 394 void InitializeCurrentSessionName(); |
| 394 | 395 |
| 395 // Updates the server data based upon the current client session. If no node | 396 // Updates the server data based upon the current client session. If no node |
| 396 // corresponding to this machine exists in the sync model, one is created. | 397 // corresponding to this machine exists in the sync model, one is created. |
| 397 // Returns true on success, false if association failed. | 398 // Returns true on success, false if association failed. |
| 398 bool UpdateSyncModelDataFromClient(syncer::SyncError* error); | 399 bool UpdateSyncModelDataFromClient(syncer::SyncError* error); |
| 399 | 400 |
| 400 // Pulls the current sync model from the sync database and returns true upon | 401 // Pulls the current sync model from the sync database and returns true upon |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 std::map<std::string, linked_ptr<SyncedFaviconInfo> > synced_favicons_; | 544 std::map<std::string, linked_ptr<SyncedFaviconInfo> > synced_favicons_; |
| 544 // Map of page URL -> favicon url. | 545 // Map of page URL -> favicon url. |
| 545 std::map<std::string, std::string> synced_favicon_pages_; | 546 std::map<std::string, std::string> synced_favicon_pages_; |
| 546 | 547 |
| 547 DISALLOW_COPY_AND_ASSIGN(SessionModelAssociator); | 548 DISALLOW_COPY_AND_ASSIGN(SessionModelAssociator); |
| 548 }; | 549 }; |
| 549 | 550 |
| 550 } // namespace browser_sync | 551 } // namespace browser_sync |
| 551 | 552 |
| 552 #endif // CHROME_BROWSER_SYNC_GLUE_SESSION_MODEL_ASSOCIATOR_H_ | 553 #endif // CHROME_BROWSER_SYNC_GLUE_SESSION_MODEL_ASSOCIATOR_H_ |
| OLD | NEW |