| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 virtual const sync_pb::SessionSpecifics* GetChromeNodeFromSyncId( | 86 virtual const sync_pb::SessionSpecifics* GetChromeNodeFromSyncId( |
| 87 int64 sync_id); | 87 int64 sync_id); |
| 88 | 88 |
| 89 // Returns whether a node with the given permanent tag was found and update | 89 // Returns whether a node with the given permanent tag was found and update |
| 90 // |sync_id| with that node's id. | 90 // |sync_id| with that node's id. |
| 91 virtual bool GetSyncIdForTaggedNode(const std::string* tag, int64* sync_id); | 91 virtual bool GetSyncIdForTaggedNode(const std::string* tag, int64* sync_id); |
| 92 | 92 |
| 93 // Returns sync id for the given chrome model id. | 93 // Returns sync id for the given chrome model id. |
| 94 // Returns sync_api::kInvalidId if the sync node is not found for the given | 94 // Returns sync_api::kInvalidId if the sync node is not found for the given |
| 95 // chrome id. | 95 // chrome id. |
| 96 virtual int64 GetSyncIdFromChromeId(std::string id); | 96 virtual int64 GetSyncIdFromChromeId(const std::string& id); |
| 97 | 97 |
| 98 | 98 |
| 99 // Initializes the given sync node from the given chrome node id. | 99 // Initializes the given sync node from the given chrome node id. |
| 100 // Returns false if no sync node was found for the given chrome node id or | 100 // Returns false if no sync node was found for the given chrome node id or |
| 101 // if the initialization of sync node fails. | 101 // if the initialization of sync node fails. |
| 102 virtual bool InitSyncNodeFromChromeId(std::string id, | 102 virtual bool InitSyncNodeFromChromeId(const std::string& id, |
| 103 sync_api::BaseNode* sync_node) { | 103 sync_api::BaseNode* sync_node) { |
| 104 return false; | 104 return false; |
| 105 } | 105 } |
| 106 | 106 |
| 107 // The has_nodes out parameter is set to true if the sync model has | 107 // The has_nodes out parameter is set to true if the sync model has |
| 108 // nodes other than the permanent tagged nodes. The method may | 108 // nodes other than the permanent tagged nodes. The method may |
| 109 // return false if an error occurred. | 109 // return false if an error occurred. |
| 110 virtual bool SyncModelHasUserCreatedNodes(bool* has_nodes); | 110 virtual bool SyncModelHasUserCreatedNodes(bool* has_nodes); |
| 111 | 111 |
| 112 // Returns the tag used to uniquely identify this machine's session in the | 112 // Returns the tag used to uniquely identify this machine's session in the |
| 113 // sync model. | 113 // sync model. |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 211 |
| 212 // Consumer used to obtain the current session. | 212 // Consumer used to obtain the current session. |
| 213 CancelableRequestConsumer consumer_; | 213 CancelableRequestConsumer consumer_; |
| 214 | 214 |
| 215 DISALLOW_COPY_AND_ASSIGN(SessionModelAssociator); | 215 DISALLOW_COPY_AND_ASSIGN(SessionModelAssociator); |
| 216 }; | 216 }; |
| 217 | 217 |
| 218 } // namespace browser_sync | 218 } // namespace browser_sync |
| 219 | 219 |
| 220 #endif // CHROME_BROWSER_SYNC_GLUE_SESSION_MODEL_ASSOCIATOR_H_ | 220 #endif // CHROME_BROWSER_SYNC_GLUE_SESSION_MODEL_ASSOCIATOR_H_ |
| OLD | NEW |