OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_FAVICON_CACHE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_FAVICON_CACHE_H_ |
6 #define CHROME_BROWSER_SYNC_GLUE_FAVICON_CACHE_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_FAVICON_CACHE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // Observer interface. | 46 // Observer interface. |
47 class FaviconCacheObserver { | 47 class FaviconCacheObserver { |
48 public: | 48 public: |
49 virtual void OnFaviconUpdated(const GURL& page_url, const GURL& icon_url) = 0; | 49 virtual void OnFaviconUpdated(const GURL& page_url, const GURL& icon_url) = 0; |
50 | 50 |
51 protected: | 51 protected: |
52 virtual ~FaviconCacheObserver(); | 52 virtual ~FaviconCacheObserver(); |
53 }; | 53 }; |
54 | 54 |
55 // Encapsulates the logic for loading and storing synced favicons. | 55 // Encapsulates the logic for loading and storing synced favicons. |
56 // TODO(zea): make this a ProfileKeyedService. | 56 // TODO(zea): make this a BrowserContextKeyedService. |
57 class FaviconCache : public syncer::SyncableService, | 57 class FaviconCache : public syncer::SyncableService, |
58 public content::NotificationObserver { | 58 public content::NotificationObserver { |
59 public: | 59 public: |
60 FaviconCache(Profile* profile, int max_sync_favicon_limit); | 60 FaviconCache(Profile* profile, int max_sync_favicon_limit); |
61 virtual ~FaviconCache(); | 61 virtual ~FaviconCache(); |
62 | 62 |
63 // SyncableService implementation. | 63 // SyncableService implementation. |
64 virtual syncer::SyncMergeResult MergeDataAndStartSyncing( | 64 virtual syncer::SyncMergeResult MergeDataAndStartSyncing( |
65 syncer::ModelType type, | 65 syncer::ModelType type, |
66 const syncer::SyncDataList& initial_sync_data, | 66 const syncer::SyncDataList& initial_sync_data, |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 244 |
245 // Maximum number of favicons to sync. 0 means no limit. | 245 // Maximum number of favicons to sync. 0 means no limit. |
246 const size_t max_sync_favicon_limit_; | 246 const size_t max_sync_favicon_limit_; |
247 | 247 |
248 DISALLOW_COPY_AND_ASSIGN(FaviconCache); | 248 DISALLOW_COPY_AND_ASSIGN(FaviconCache); |
249 }; | 249 }; |
250 | 250 |
251 } // namespace browser_sync | 251 } // namespace browser_sync |
252 | 252 |
253 #endif // CHROME_BROWSER_SYNC_GLUE_FAVICON_CACHE_H_ | 253 #endif // CHROME_BROWSER_SYNC_GLUE_FAVICON_CACHE_H_ |
OLD | NEW |