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_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 const std::vector<GURL>& icon_urls, | 669 const std::vector<GURL>& icon_urls, |
670 int icon_types, | 670 int icon_types, |
671 int desired_size_in_dip, | 671 int desired_size_in_dip, |
672 const std::vector<ui::ScaleFactor>& desired_scale_factors, | 672 const std::vector<ui::ScaleFactor>& desired_scale_factors, |
673 FaviconResults* results); | 673 FaviconResults* results); |
674 | 674 |
675 // Set the favicon bitmaps for |icon_id|. | 675 // Set the favicon bitmaps for |icon_id|. |
676 // For each entry in |favicon_bitmap_data|, if a favicon bitmap already | 676 // For each entry in |favicon_bitmap_data|, if a favicon bitmap already |
677 // exists at the entry's pixel size, replace the favicon bitmap's data with | 677 // exists at the entry's pixel size, replace the favicon bitmap's data with |
678 // the entry's bitmap data. Otherwise add a new favicon bitmap. | 678 // the entry's bitmap data. Otherwise add a new favicon bitmap. |
| 679 // If not NULL, |favicon_bitmaps_changed| is set to whether any of the bitmap |
| 680 // data at |icon_id| is changed as a result of calling this method. |
679 void SetFaviconBitmaps( | 681 void SetFaviconBitmaps( |
680 FaviconID icon_id, | 682 FaviconID icon_id, |
681 const std::vector<FaviconBitmapData>& favicon_bitmap_data); | 683 const std::vector<FaviconBitmapData>& favicon_bitmap_data, |
| 684 bool* favicon_bitmaps_changed); |
682 | 685 |
683 // Returns true if |favicon_bitmap_data| and |icon_url_sizes| passed to | 686 // Returns true if |favicon_bitmap_data| and |icon_url_sizes| passed to |
684 // SetFavicons() are valid. | 687 // SetFavicons() are valid. |
685 // Criteria: | 688 // Criteria: |
686 // 1) |icon_url_sizes| contains no more than | 689 // 1) |icon_url_sizes| contains no more than |
687 // kMaxFaviconsPerPage icon URLs. | 690 // kMaxFaviconsPerPage icon URLs. |
688 // kMaxFaviconBitmapsPerIconURL favicon sizes for each icon URL. | 691 // kMaxFaviconBitmapsPerIconURL favicon sizes for each icon URL. |
689 // 2) The icon URLs and favicon sizes of |favicon_bitmap_data| are a subset | 692 // 2) The icon URLs and favicon sizes of |favicon_bitmap_data| are a subset |
690 // of |icon_url_sizes|. | 693 // of |icon_url_sizes|. |
691 // 3) The favicon sizes for entries in |icon_url_sizes| which have associated | 694 // 3) The favicon sizes for entries in |icon_url_sizes| which have associated |
692 // data in |favicon_bitmap_data| is not history::GetDefaultFaviconSizes(). | 695 // data in |favicon_bitmap_data| is not history::GetDefaultFaviconSizes(). |
693 // 4) FaviconBitmapData::bitmap_data contains non NULL bitmap data. | 696 // 4) FaviconBitmapData::bitmap_data contains non NULL bitmap data. |
694 bool ValidateSetFaviconsParams( | 697 bool ValidateSetFaviconsParams( |
695 const std::vector<FaviconBitmapData>& favicon_bitmap_data, | 698 const std::vector<FaviconBitmapData>& favicon_bitmap_data, |
696 const IconURLSizesMap& icon_url_sizes) const; | 699 const IconURLSizesMap& icon_url_sizes) const; |
697 | 700 |
698 // Sets the sizes that the thumbnail database knows that the favicon at | 701 // Sets the sizes that the thumbnail database knows that the favicon at |
699 // |icon_id| is available from the web. See history_types.h for a more | 702 // |icon_id| is available from the web. See history_types.h for a more |
700 // detailed description of FaviconSizes. | 703 // detailed description of FaviconSizes. |
701 // Deletes any favicon bitmaps currently mapped to |icon_id| whose pixel | 704 // Deletes any favicon bitmaps currently mapped to |icon_id| whose pixel |
702 // sizes are not contained in |favicon_sizes|. | 705 // sizes are not contained in |favicon_sizes|. |
| 706 // |favicon_bitmaps_deleted| is set to true if at least one favicon bitmap |
| 707 // is deleted. |
703 void SetFaviconSizes(FaviconID icon_id, | 708 void SetFaviconSizes(FaviconID icon_id, |
704 const FaviconSizes& favicon_sizes); | 709 const FaviconSizes& favicon_sizes, |
| 710 bool* favicon_bitmaps_deleted); |
| 711 |
| 712 // Returns true if |new_bitmap_data| equals the bitmap data at |bitmap_id|. |
| 713 bool IsFaviconBitmapDataEqual( |
| 714 FaviconBitmapID bitmap_id, |
| 715 const scoped_refptr<base::RefCountedMemory>& new_bitmap_data); |
705 | 716 |
706 // Returns true if there are favicons for |page_url| and one of the types in | 717 // Returns true if there are favicons for |page_url| and one of the types in |
707 // |icon_types|. | 718 // |icon_types|. |
708 // |favicon_bitmap_results| is set to the favicon bitmaps which most closely | 719 // |favicon_bitmap_results| is set to the favicon bitmaps which most closely |
709 // match |desired_size_in_dip| and |desired_scale_factors|. If | 720 // match |desired_size_in_dip| and |desired_scale_factors|. If |
710 // |desired_size_in_dip| is 0, the largest favicon bitmap with one of the icon | 721 // |desired_size_in_dip| is 0, the largest favicon bitmap with one of the icon |
711 // types in |icon_types| is returned. If |icon_types| contains multiple icon | 722 // types in |icon_types| is returned. If |icon_types| contains multiple icon |
712 // types and there are several matched icon types in the database, results | 723 // types and there are several matched icon types in the database, results |
713 // will only be returned for a single icon type in the priority of | 724 // will only be returned for a single icon type in the priority of |
714 // TOUCH_PRECOMPOSED_ICON, TOUCH_ICON, and FAVICON. See the comment for | 725 // TOUCH_PRECOMPOSED_ICON, TOUCH_ICON, and FAVICON. See the comment for |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
901 // Used to provide the Android ContentProvider APIs. | 912 // Used to provide the Android ContentProvider APIs. |
902 scoped_ptr<AndroidProviderBackend> android_provider_backend_; | 913 scoped_ptr<AndroidProviderBackend> android_provider_backend_; |
903 #endif | 914 #endif |
904 | 915 |
905 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 916 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
906 }; | 917 }; |
907 | 918 |
908 } // namespace history | 919 } // namespace history |
909 | 920 |
910 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 921 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
OLD | NEW |