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_HISTORY_HISTORY_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 // bitmap for a.ico. | 797 // bitmap for a.ico. |
798 // TODO(pkotwicz): Remove once no longer required by sync. | 798 // TODO(pkotwicz): Remove once no longer required by sync. |
799 void MergeFavicon(const GURL& page_url, | 799 void MergeFavicon(const GURL& page_url, |
800 const GURL& icon_url, | 800 const GURL& icon_url, |
801 history::IconType icon_type, | 801 history::IconType icon_type, |
802 scoped_refptr<base::RefCountedMemory> bitmap_data, | 802 scoped_refptr<base::RefCountedMemory> bitmap_data, |
803 const gfx::Size& pixel_size); | 803 const gfx::Size& pixel_size); |
804 | 804 |
805 // Used by the FaviconService to set the favicons for a page on the history | 805 // Used by the FaviconService to set the favicons for a page on the history |
806 // backend. | 806 // backend. |
807 // |favicon_bitmap_data| is a listing of additional favicon bitmaps to store | 807 // |favicon_bitmap_data| replaces all the favicon bitmaps mapped to |
808 // for |page_url|. | 808 // |page_url|. |
809 // |expired| and |icon_type| fields in FaviconBitmapData are ignored. | 809 // |expired| and |icon_type| fields in FaviconBitmapData are ignored. |
810 // |icon_url_sizes| is a mapping of all the icon urls of the favicons | 810 // Use MergeFavicon() if |favicon_bitmap_data| is incomplete, and favicon |
811 // available for |page_url| to the sizes that those favicons are available | 811 // bitmaps in the database should be preserved if possible. For instance, |
812 // from the web. | 812 // favicon bitmaps from sync are 1x only. MergeFavicon() is used to avoid |
813 // |favicon_bitmap_data| does not need to have entries for all the icon urls | 813 // deleting the 2x favicon bitmap if it is present in the history backend. |
814 // or sizes listed in |icon_url_sizes|. However, the icon urls and pixel | |
815 // sizes in |favicon_bitmap_data| must be a subset of |icon_url_sizes|. It is | |
816 // important that |icon_url_sizes| be complete as mappings to favicons whose | |
817 // icon url or pixel size is not in |icon_url_sizes| will be deleted. | |
818 // Use MergeFavicon() if any of the icon URLs for |page_url| or any of the | |
819 // favicon sizes of the icon URLs are not known. | |
820 // See HistoryBackend::ValidateSetFaviconsParams() for more details on the | 814 // See HistoryBackend::ValidateSetFaviconsParams() for more details on the |
821 // criteria for |favicon_bitmap_data| and |icon_url_sizes| to be valid. | 815 // criteria for |favicon_bitmap_data| to be valid. |
822 void SetFavicons( | 816 void SetFavicons( |
823 const GURL& page_url, | 817 const GURL& page_url, |
824 history::IconType icon_type, | 818 history::IconType icon_type, |
825 const std::vector<history::FaviconBitmapData>& favicon_bitmap_data, | 819 const std::vector<history::FaviconBitmapData>& favicon_bitmap_data); |
826 const history::IconURLSizesMap& icon_url_sizes); | |
827 | 820 |
828 // Used by the FaviconService to mark the favicon for the page as being out | 821 // Used by the FaviconService to mark the favicon for the page as being out |
829 // of date. | 822 // of date. |
830 void SetFaviconsOutOfDateForPage(const GURL& page_url); | 823 void SetFaviconsOutOfDateForPage(const GURL& page_url); |
831 | 824 |
832 // Used by the FaviconService to clone favicons from one page to another, | 825 // Used by the FaviconService to clone favicons from one page to another, |
833 // provided that other page does not already have favicons. | 826 // provided that other page does not already have favicons. |
834 void CloneFavicons(const GURL& old_page_url, const GURL& new_page_url); | 827 void CloneFavicons(const GURL& old_page_url, const GURL& new_page_url); |
835 | 828 |
836 // Used by the FaviconService for importing many favicons for many pages at | 829 // Used by the FaviconService for importing many favicons for many pages at |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1112 // TODO(mrossetti): Move in_memory_url_index out of history_service. | 1105 // TODO(mrossetti): Move in_memory_url_index out of history_service. |
1113 // See http://crbug.com/138321 | 1106 // See http://crbug.com/138321 |
1114 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; | 1107 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; |
1115 | 1108 |
1116 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; | 1109 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; |
1117 | 1110 |
1118 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 1111 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
1119 }; | 1112 }; |
1120 | 1113 |
1121 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ | 1114 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ |
OLD | NEW |