OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "chrome/browser/sync/glue/favicon_cache.h" | 5 #include "chrome/browser/sync/glue/favicon_cache.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/favicon/favicon_service.h" | 10 #include "chrome/browser/favicon/favicon_service.h" |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 } | 570 } |
571 | 571 |
572 void FaviconCache::Observe(int type, | 572 void FaviconCache::Observe(int type, |
573 const content::NotificationSource& source, | 573 const content::NotificationSource& source, |
574 const content::NotificationDetails& details) { | 574 const content::NotificationDetails& details) { |
575 DCHECK_EQ(type, chrome::NOTIFICATION_HISTORY_URLS_DELETED); | 575 DCHECK_EQ(type, chrome::NOTIFICATION_HISTORY_URLS_DELETED); |
576 | 576 |
577 content::Details<history::URLsDeletedDetails> deleted_details(details); | 577 content::Details<history::URLsDeletedDetails> deleted_details(details); |
578 | 578 |
579 // We only care about actual user (or sync) deletions. | 579 // We only care about actual user (or sync) deletions. |
580 if (deleted_details->archived) | 580 if (deleted_details->expired) |
581 return; | 581 return; |
582 | 582 |
583 if (!deleted_details->all_history) { | 583 if (!deleted_details->all_history) { |
584 DeleteSyncedFavicons(deleted_details->favicon_urls); | 584 DeleteSyncedFavicons(deleted_details->favicon_urls); |
585 return; | 585 return; |
586 } | 586 } |
587 | 587 |
588 // All history was cleared: just delete all favicons. | 588 // All history was cleared: just delete all favicons. |
589 DVLOG(1) << "History clear detected, deleting all synced favicons."; | 589 DVLOG(1) << "History clear detected, deleting all synced favicons."; |
590 syncer::SyncChangeList image_deletions, tracking_deletions; | 590 syncer::SyncChangeList image_deletions, tracking_deletions; |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 | 1056 |
1057 size_t FaviconCache::NumFaviconsForTest() const { | 1057 size_t FaviconCache::NumFaviconsForTest() const { |
1058 return synced_favicons_.size(); | 1058 return synced_favicons_.size(); |
1059 } | 1059 } |
1060 | 1060 |
1061 size_t FaviconCache::NumTasksForTest() const { | 1061 size_t FaviconCache::NumTasksForTest() const { |
1062 return page_task_map_.size(); | 1062 return page_task_map_.size(); |
1063 } | 1063 } |
1064 | 1064 |
1065 } // namespace browser_sync | 1065 } // namespace browser_sync |
OLD | NEW |