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 COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ | 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ |
6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ | 6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 // |page_url| for |icon_type|. | 754 // |page_url| for |icon_type|. |
755 // Use MergeFavicon() if |bitmaps| is incomplete, and favicon bitmaps in the | 755 // Use MergeFavicon() if |bitmaps| is incomplete, and favicon bitmaps in the |
756 // database should be preserved if possible. For instance, favicon bitmaps | 756 // database should be preserved if possible. For instance, favicon bitmaps |
757 // from sync are 1x only. MergeFavicon() is used to avoid deleting the 2x | 757 // from sync are 1x only. MergeFavicon() is used to avoid deleting the 2x |
758 // favicon bitmap if it is present in the history backend. | 758 // favicon bitmap if it is present in the history backend. |
759 void SetFavicons(const GURL& page_url, | 759 void SetFavicons(const GURL& page_url, |
760 favicon_base::IconType icon_type, | 760 favicon_base::IconType icon_type, |
761 const GURL& icon_url, | 761 const GURL& icon_url, |
762 const std::vector<SkBitmap>& bitmaps); | 762 const std::vector<SkBitmap>& bitmaps); |
763 | 763 |
| 764 // Same as SetFavicons with three differences: |
| 765 // 1) It will be a no-op if there is an existing cached favicon for *any* type |
| 766 // for |page_url|. |
| 767 // 2) If |icon_url| is known to the database, |bitmaps| will be ignored (i.e. |
| 768 // the icon won't be overwritten) but the mappings from |page_url| to |
| 769 // |icon_url| will be stored (conditioned to point 1 above). |
| 770 // 3) If |icon_url| is stored, it will be marked as expired. |
| 771 // The callback will receive whether the write actually happened. |
| 772 void SetLastResortFavicons(const GURL& page_url, |
| 773 favicon_base::IconType icon_type, |
| 774 const GURL& icon_url, |
| 775 const std::vector<SkBitmap>& bitmaps, |
| 776 base::Callback<void(bool)> callback); |
| 777 |
764 // Used by the FaviconService to mark the favicon for the page as being out | 778 // Used by the FaviconService to mark the favicon for the page as being out |
765 // of date. | 779 // of date. |
766 void SetFaviconsOutOfDateForPage(const GURL& page_url); | 780 void SetFaviconsOutOfDateForPage(const GURL& page_url); |
767 | 781 |
768 // Used by the FaviconService for importing many favicons for many pages at | 782 // Used by the FaviconService for importing many favicons for many pages at |
769 // once. The pages must exist, any favicon sets for unknown pages will be | 783 // once. The pages must exist, any favicon sets for unknown pages will be |
770 // discarded. Existing favicons will not be overwritten. | 784 // discarded. Existing favicons will not be overwritten. |
771 void SetImportedFavicons( | 785 void SetImportedFavicons( |
772 const favicon_base::FaviconUsageDataList& favicon_usage); | 786 const favicon_base::FaviconUsageDataList& favicon_usage); |
773 | 787 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 | 850 |
837 // All vended weak pointers are invalidated in Cleanup(). | 851 // All vended weak pointers are invalidated in Cleanup(). |
838 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; | 852 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; |
839 | 853 |
840 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 854 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
841 }; | 855 }; |
842 | 856 |
843 } // namespace history | 857 } // namespace history |
844 | 858 |
845 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ | 859 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ |
OLD | NEW |