Chromium Code Reviews| Index: chrome/browser/history/thumbnail_database.h |
| diff --git a/chrome/browser/history/thumbnail_database.h b/chrome/browser/history/thumbnail_database.h |
| index 7a1780f776fc909fe8e6291e41b6e6752ebe2fbd..95c62b1a8f0088faace0e939f6d59ba13334a2b6 100644 |
| --- a/chrome/browser/history/thumbnail_database.h |
| +++ b/chrome/browser/history/thumbnail_database.h |
| @@ -99,11 +99,24 @@ class ThumbnailDatabase { |
| // Favicon Bitmaps ----------------------------------------------------------- |
| + // Returns a listing of the favicon bitmap ids and their associated pixel |
| + // sizes for the favicon with |icon_id|. Returns true if the listing has at |
| + // least one entry. |
| + bool GetFaviconBitmapIDSizeListing( |
|
sky
2012/08/21 20:16:56
GetFaviconBitmapIDSizes
|
| + FaviconID icon_id, |
| + std::vector<FaviconBitmapIDSize>* bitmap_size_listing); |
| + |
| // Returns true if there are any matched bitmaps for the given |icon_id|. All |
| // matched results are returned if |favicon_bitmaps| is not NULL. |
| bool GetFaviconBitmaps(FaviconID icon_id, |
| std::vector<FaviconBitmap>* favicon_bitmaps); |
| +// Sets the bitmap data and the last updated time for the favicon bitmap at |
| +// |bitmap_id|. Returns true if successful. |
| + bool SetFaviconBitmap(FaviconBitmapID bitmap_id, |
| + scoped_refptr<base::RefCountedMemory> icon_data, |
| + base::Time time); |
| + |
| // Adds a bitmap component at |pixel_size| for the favicon with |icon_id|. |
| // Only favicons representing a .ico file should have multiple favicon bitmaps |
| // per favicon. |
| @@ -118,9 +131,8 @@ class ThumbnailDatabase { |
| base::Time time, |
| const gfx::Size& pixel_size); |
| - // Deletes the favicon bitmaps for the favicon with with |icon_id|. |
| - // Returns true if successful. |
| - bool DeleteFaviconBitmapsForFavicon(FaviconID icon_id); |
| + // Deletes the favicon bitmap with |bitmap_id|. Returns true if successful. |
| + bool DeleteFaviconBitmap(FaviconBitmapID bitmap_id); |
| // Favicons ------------------------------------------------------------------ |
| @@ -136,21 +148,10 @@ class ThumbnailDatabase { |
| // and icon type. If |required_icon_type| contains multiple icon types and |
| // there are more than one matched icon in database, only one icon will be |
| // returned in the priority of TOUCH_PRECOMPOSED_ICON, TOUCH_ICON, and |
| - // FAVICON, and the icon type is returned in icon_type parameter if it is not |
| - // NULL. |
| + // FAVICON. |
| // Returns 0 if no entry exists for the specified url. |
| FaviconID GetFaviconIDForFaviconURL(const GURL& icon_url, |
| - int required_icon_type, |
| - IconType* icon_type); |
| - |
| - // Gets the png encoded favicon, last updated time, icon_url and icon_type for |
| - // the specified favicon id. |
| - // TODO(pkotwicz): Remove this function. |
| - bool GetFavicon(FaviconID icon_id, |
| - base::Time* last_updated, |
| - scoped_refptr<base::RefCountedMemory>* png_icon_data, |
| - GURL* icon_url, |
| - IconType* icon_type); |
| + int required_icon_type); |
| // Gets the icon_url, icon_type and sizes for the specified |icon_id|. |
| bool GetFaviconHeader(FaviconID icon_id, |
| @@ -158,7 +159,8 @@ class ThumbnailDatabase { |
| IconType* icon_type, |
| std::string* sizes); |
| - // Adds the favicon URL and icon type to the favicon db, returning its id. |
| + // Adds favicon with |icon_url| and |icon_type| to the favicon db, returning |
| + // its id. |
| FaviconID AddFavicon(const GURL& icon_url, IconType icon_type); |
| // Adds a favicon with a single bitmap. This call is equivalent to calling |
| @@ -179,9 +181,17 @@ class ThumbnailDatabase { |
| // icon type. |
| // The matched icon mapping is returned in the icon_mapping parameter if it is |
| // not NULL. |
| - bool GetIconMappingForPageURL(const GURL& page_url, |
| - IconType required_icon_type, |
| - IconMapping* icon_mapping); |
| + |
| + // Returns true if there are icon mappings for the given page and icon type. |
| + // If |required_icon_types| contains multiple icon types and there is more |
| + // than one matched icon type in the database, icons of only a single type |
| + // will be returned in the priority of TOUCH_PRECOMPOSED_ICON, TOUCH_ICON, |
| + // and FAVICON. |
| + // The matched icon mappings are returned in the |icon_mappings| parameter if |
| + // it is not NULL. |
| + bool GetIconMappingsForPageURL(const GURL& page_url, |
| + int required_icon_types, |
| + std::vector<IconMapping>* mapping_data); |
| // Returns true if there is any matched icon mapping for the given page. |
| // All matched icon mappings are returned in descent order of IconType if |
| @@ -202,12 +212,16 @@ class ThumbnailDatabase { |
| // Returns true if the deletion succeeded. |
| bool DeleteIconMappings(const GURL& page_url); |
| + // Deletes the icon mapping with |mapping_id|. |
| + // Returns true if the deletion succeeded. |
| + bool DeleteIconMapping(IconMappingID mapping_id); |
| + |
| // Checks whether a favicon is used by any URLs in the database. |
| bool HasMappingFor(FaviconID id); |
| // Clones the existing mappings from |old_page_url| if |new_page_url| has no |
| // mappings. Otherwise, will leave mappings alone. |
| - bool CloneIconMapping(const GURL& old_page_url, const GURL& new_page_url); |
| + bool CloneIconMappings(const GURL& old_page_url, const GURL& new_page_url); |
| // The class to enumerate icon mappings. Use InitIconMappingEnumerator to |
| // initialize. |