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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 bool ShouldSyncTab(const SyncedTabDelegate& tab) const; | 213 bool ShouldSyncTab(const SyncedTabDelegate& tab) const; |
214 | 214 |
215 // Compare |urls| against |tab_map_|'s urls to see if any tabs with | 215 // Compare |urls| against |tab_map_|'s urls to see if any tabs with |
216 // outstanding favicon loads can be fulfilled. | 216 // outstanding favicon loads can be fulfilled. |
217 void FaviconsUpdated(const std::set<GURL>& urls); | 217 void FaviconsUpdated(const std::set<GURL>& urls); |
218 | 218 |
219 // Returns the syncable model type. | 219 // Returns the syncable model type. |
220 static syncer::ModelType model_type() { return syncer::SESSIONS; } | 220 static syncer::ModelType model_type() { return syncer::SESSIONS; } |
221 | 221 |
222 // Testing only. Will cause the associator to call MessageLoop::Quit() | 222 // Testing only. Will cause the associator to call MessageLoop::Quit() |
223 // when a local change is made, or when timeout_milli occurs, whichever is | 223 // when a local change is made, or when timeout occurs, whichever is |
224 // first. | 224 // first. |
225 void BlockUntilLocalChangeForTest(int64 timeout_milli); | 225 void BlockUntilLocalChangeForTest(base::TimeDelta timeout); |
226 | 226 |
227 // Callback for when the session name has been computed. | 227 // Callback for when the session name has been computed. |
228 void OnSessionNameInitialized(const std::string& name); | 228 void OnSessionNameInitialized(const std::string& name); |
229 | 229 |
230 // If a valid favicon for the page at |url| is found, fills |png_favicon| with | 230 // If a valid favicon for the page at |url| is found, fills |png_favicon| with |
231 // the png-encoded image and returns true. Else, returns false. | 231 // the png-encoded image and returns true. Else, returns false. |
232 bool GetSyncedFaviconForPageURL(const std::string& url, | 232 bool GetSyncedFaviconForPageURL(const std::string& url, |
233 std::string* png_favicon) const; | 233 std::string* png_favicon) const; |
234 | 234 |
235 private: | 235 private: |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 std::map<std::string, linked_ptr<SyncedFaviconInfo> > synced_favicons_; | 558 std::map<std::string, linked_ptr<SyncedFaviconInfo> > synced_favicons_; |
559 // Map of page URL -> favicon url. | 559 // Map of page URL -> favicon url. |
560 std::map<std::string, std::string> synced_favicon_pages_; | 560 std::map<std::string, std::string> synced_favicon_pages_; |
561 | 561 |
562 DISALLOW_COPY_AND_ASSIGN(SessionModelAssociator); | 562 DISALLOW_COPY_AND_ASSIGN(SessionModelAssociator); |
563 }; | 563 }; |
564 | 564 |
565 } // namespace browser_sync | 565 } // namespace browser_sync |
566 | 566 |
567 #endif // CHROME_BROWSER_SYNC_GLUE_SESSION_MODEL_ASSOCIATOR_H_ | 567 #endif // CHROME_BROWSER_SYNC_GLUE_SESSION_MODEL_ASSOCIATOR_H_ |
OLD | NEW |