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 #include "components/history/core/browser/history_backend.h" | 5 #include "components/history/core/browser/history_backend.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 1751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1762 !thumbnail_db_->GetIconMappingsForPageURL(page_url, &icon_mappings)) | 1762 !thumbnail_db_->GetIconMappingsForPageURL(page_url, &icon_mappings)) |
1763 return; | 1763 return; |
1764 | 1764 |
1765 for (std::vector<IconMapping>::iterator m = icon_mappings.begin(); | 1765 for (std::vector<IconMapping>::iterator m = icon_mappings.begin(); |
1766 m != icon_mappings.end(); ++m) { | 1766 m != icon_mappings.end(); ++m) { |
1767 thumbnail_db_->SetFaviconOutOfDate(m->icon_id); | 1767 thumbnail_db_->SetFaviconOutOfDate(m->icon_id); |
1768 } | 1768 } |
1769 ScheduleCommit(); | 1769 ScheduleCommit(); |
1770 } | 1770 } |
1771 | 1771 |
1772 void HistoryBackend::CloneFavicons(const GURL& old_page_url, | |
1773 const GURL& new_page_url) { | |
1774 if (!thumbnail_db_) | |
1775 return; | |
1776 | |
1777 // Prevent cross-domain cloning. | |
1778 if (old_page_url.GetOrigin() != new_page_url.GetOrigin()) | |
1779 return; | |
1780 | |
1781 thumbnail_db_->CloneIconMappings(old_page_url, new_page_url); | |
1782 ScheduleCommit(); | |
1783 } | |
1784 | |
1785 void HistoryBackend::SetImportedFavicons( | 1772 void HistoryBackend::SetImportedFavicons( |
1786 const favicon_base::FaviconUsageDataList& favicon_usage) { | 1773 const favicon_base::FaviconUsageDataList& favicon_usage) { |
1787 if (!db_ || !thumbnail_db_) | 1774 if (!db_ || !thumbnail_db_) |
1788 return; | 1775 return; |
1789 | 1776 |
1790 Time now = Time::Now(); | 1777 Time now = Time::Now(); |
1791 | 1778 |
1792 // Track all URLs that had their favicons set or updated. | 1779 // Track all URLs that had their favicons set or updated. |
1793 std::set<GURL> favicons_changed; | 1780 std::set<GURL> favicons_changed; |
1794 | 1781 |
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2661 info.url_id = visit.url_id; | 2648 info.url_id = visit.url_id; |
2662 info.time = visit.visit_time; | 2649 info.time = visit.visit_time; |
2663 info.transition = visit.transition; | 2650 info.transition = visit.transition; |
2664 // If we don't have a delegate yet during setup or shutdown, we will drop | 2651 // If we don't have a delegate yet during setup or shutdown, we will drop |
2665 // these notifications. | 2652 // these notifications. |
2666 if (delegate_) | 2653 if (delegate_) |
2667 delegate_->NotifyAddVisit(info); | 2654 delegate_->NotifyAddVisit(info); |
2668 } | 2655 } |
2669 | 2656 |
2670 } // namespace history | 2657 } // namespace history |
OLD | NEW |