| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // Note that the specifics_ vector is reset and built from scratch each time. | 122 // Note that the specifics_ vector is reset and built from scratch each time. |
| 123 bool UpdateFromSyncModel(const sync_api::BaseTransaction* trans); | 123 bool UpdateFromSyncModel(const sync_api::BaseTransaction* trans); |
| 124 | 124 |
| 125 // Helper for UpdateFromSyncModel. Appends sync data to a vector of specifics. | 125 // Helper for UpdateFromSyncModel. Appends sync data to a vector of specifics. |
| 126 bool QuerySyncModel(const sync_api::BaseTransaction* trans, | 126 bool QuerySyncModel(const sync_api::BaseTransaction* trans, |
| 127 std::vector<const sync_pb::SessionSpecifics*>& specifics); | 127 std::vector<const sync_pb::SessionSpecifics*>& specifics); |
| 128 | 128 |
| 129 // Builds sessions from buffered specifics data | 129 // Builds sessions from buffered specifics data |
| 130 bool GetSessionData(std::vector<ForeignSession*>* sessions); | 130 bool GetSessionData(std::vector<ForeignSession*>* sessions); |
| 131 | 131 |
| 132 // Helper method to generate session specifics from session windows. |
| 133 void FillSpecificsFromSessions(std::vector<SessionWindow*>* windows, |
| 134 sync_pb::SessionSpecifics* session); |
| 135 |
| 132 // Helper method for converting session specifics to windows. | 136 // Helper method for converting session specifics to windows. |
| 133 void AppendForeignSessionFromSpecifics( | 137 void AppendForeignSessionFromSpecifics( |
| 134 const sync_pb::SessionSpecifics* specifics, | 138 const sync_pb::SessionSpecifics* specifics, |
| 135 std::vector<ForeignSession*>* session); | 139 std::vector<ForeignSession*>* session); |
| 136 | 140 |
| 137 // Fills the given empty vector with foreign session windows to restore. | 141 // Fills the given empty vector with foreign session windows to restore. |
| 138 // If the vector is returned empty, then the session data could not be | 142 // If the vector is returned empty, then the session data could not be |
| 139 // converted back into windows. | 143 // converted back into windows. |
| 140 void AppendForeignSessionWithID(int64 id, | 144 void AppendForeignSessionWithID(int64 id, |
| 141 std::vector<ForeignSession*>* session, | 145 std::vector<ForeignSession*>* session, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 211 |
| 208 // Consumer used to obtain the current session. | 212 // Consumer used to obtain the current session. |
| 209 CancelableRequestConsumer consumer_; | 213 CancelableRequestConsumer consumer_; |
| 210 | 214 |
| 211 DISALLOW_COPY_AND_ASSIGN(SessionModelAssociator); | 215 DISALLOW_COPY_AND_ASSIGN(SessionModelAssociator); |
| 212 }; | 216 }; |
| 213 | 217 |
| 214 } // namespace browser_sync | 218 } // namespace browser_sync |
| 215 | 219 |
| 216 #endif // CHROME_BROWSER_SYNC_GLUE_SESSION_MODEL_ASSOCIATOR_H_ | 220 #endif // CHROME_BROWSER_SYNC_GLUE_SESSION_MODEL_ASSOCIATOR_H_ |
| OLD | NEW |