Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(901)

Side by Side Diff: components/history/core/browser/history_service.h

Issue 2823093002: Make FaviconService::GetRawFaviconForPageURL() select the best candidate among all the icon types (Closed)
Patch Set: Merge branch 'master' into icon_type Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 // deleted. |url_id| is the id of the url row. 637 // deleted. |url_id| is the id of the url row.
638 void NotifyKeywordSearchTermDeleted(URLID url_id); 638 void NotifyKeywordSearchTermDeleted(URLID url_id);
639 639
640 // Favicon ------------------------------------------------------------------- 640 // Favicon -------------------------------------------------------------------
641 641
642 // These favicon methods are exposed to the FaviconService. Instead of calling 642 // These favicon methods are exposed to the FaviconService. Instead of calling
643 // these methods directly you should call the respective method on the 643 // these methods directly you should call the respective method on the
644 // FaviconService. 644 // FaviconService.
645 645
646 // Used by FaviconService to get the favicon bitmaps from the history backend 646 // Used by FaviconService to get the favicon bitmaps from the history backend
647 // whose edge sizes most closely match |desired_sizes| for |icon_types|. If 647 // whose edge sizes most closely match |desired_sizes| for |icon_type|. If
648 // |desired_sizes| has a '0' entry, the largest favicon bitmap for 648 // |desired_sizes| has a '0' entry, the largest favicon bitmap for
649 // |icon_types| is returned. The returned FaviconBitmapResults will have at 649 // |icon_type| is returned. The returned FaviconBitmapResults will have at
650 // most one result for each entry in |desired_sizes|. If a favicon bitmap is 650 // most one result for each entry in |desired_sizes|. If a favicon bitmap is
651 // determined to be the best candidate for multiple |desired_sizes| there will 651 // determined to be the best candidate for multiple |desired_sizes| there will
652 // be fewer results. 652 // be fewer results.
653 // If |icon_types| has several types, results for only a single type will be 653 base::CancelableTaskTracker::TaskId GetFavicon(
654 // returned in the priority of TOUCH_PRECOMPOSED_ICON, TOUCH_ICON, and 654 const GURL& icon_url,
655 // FAVICON. 655 favicon_base::IconType icon_type,
656 base::CancelableTaskTracker::TaskId GetFavicons(
657 const std::vector<GURL>& icon_urls,
658 int icon_types,
659 const std::vector<int>& desired_sizes, 656 const std::vector<int>& desired_sizes,
660 const favicon_base::FaviconResultsCallback& callback, 657 const favicon_base::FaviconResultsCallback& callback,
661 base::CancelableTaskTracker* tracker); 658 base::CancelableTaskTracker* tracker);
662 659
663 // Used by the FaviconService to get favicons mapped to |page_url| for 660 // Used by the FaviconService to get favicons mapped to |page_url| for
664 // |icon_types| whose edge sizes most closely match |desired_sizes|. If 661 // |icon_types| whose edge sizes most closely match |desired_sizes|. If
665 // |desired_sizes| has a '0' entry, the largest favicon bitmap for 662 // |desired_sizes| has a '0' entry, the largest favicon bitmap for
666 // |icon_types| is returned. The returned FaviconBitmapResults will have at 663 // |icon_types| is returned. The returned FaviconBitmapResults will have at
667 // most one result for each entry in |desired_sizes|. If a favicon bitmap is 664 // most one result for each entry in |desired_sizes|. If a favicon bitmap is
668 // determined to be the best candidate for multiple |desired_sizes| there 665 // determined to be the best candidate for multiple |desired_sizes| there
669 // will be fewer results. If |icon_types| has several types, results for only 666 // will be fewer results.
670 // a single type will be returned in the priority of TOUCH_PRECOMPOSED_ICON,
671 // TOUCH_ICON, and FAVICON.
672 base::CancelableTaskTracker::TaskId GetFaviconsForURL( 667 base::CancelableTaskTracker::TaskId GetFaviconsForURL(
673 const GURL& page_url, 668 const GURL& page_url,
674 int icon_types, 669 int icon_types,
675 const std::vector<int>& desired_sizes, 670 const std::vector<int>& desired_sizes,
676 const favicon_base::FaviconResultsCallback& callback, 671 const favicon_base::FaviconResultsCallback& callback,
677 base::CancelableTaskTracker* tracker); 672 base::CancelableTaskTracker* tracker);
678 673
679 // Used by FaviconService to find the first favicon bitmap whose width and 674 // Used by FaviconService to find the first favicon bitmap whose width and
680 // height are greater than that of |minimum_size_in_pixels|. This searches 675 // height are greater than that of |minimum_size_in_pixels|. This searches
681 // for icons by IconType. Each element of |icon_types| is a bitmask of 676 // for icons by IconType. Each element of |icon_types| is a bitmask of
(...skipping 15 matching lines...) Expand all
697 // Used by the FaviconService to get the favicon bitmap which most closely 692 // Used by the FaviconService to get the favicon bitmap which most closely
698 // matches |desired_size| from the favicon with |favicon_id| from the history 693 // matches |desired_size| from the favicon with |favicon_id| from the history
699 // backend. If |desired_size| is 0, the largest favicon bitmap for 694 // backend. If |desired_size| is 0, the largest favicon bitmap for
700 // |favicon_id| is returned. 695 // |favicon_id| is returned.
701 base::CancelableTaskTracker::TaskId GetFaviconForID( 696 base::CancelableTaskTracker::TaskId GetFaviconForID(
702 favicon_base::FaviconID favicon_id, 697 favicon_base::FaviconID favicon_id,
703 int desired_size, 698 int desired_size,
704 const favicon_base::FaviconResultsCallback& callback, 699 const favicon_base::FaviconResultsCallback& callback,
705 base::CancelableTaskTracker* tracker); 700 base::CancelableTaskTracker* tracker);
706 701
707 // Used by the FaviconService to replace the favicon mappings to |page_url| 702 // Maps |page_url| to the favicon at |icon_url| if there is an entry in the
708 // for |icon_types| on the history backend. 703 // database for |icon_url| and |icon_type|. This occurs when there is a
709 // Sample |icon_urls|: 704 // mapping from a different page URL to |icon_url|. The favicon bitmaps whose
710 // { ICON_URL1 -> TOUCH_ICON, known to the database, 705 // edge sizes most closely match |desired_sizes| from the favicons which were
711 // ICON_URL2 -> TOUCH_ICON, not known to the database, 706 // just mapped to |page_url| are returned. If |desired_sizes| has a '0' entry,
712 // ICON_URL3 -> TOUCH_PRECOMPOSED_ICON, known to the database } 707 // the largest favicon bitmap is returned.
713 // The new mappings are computed from |icon_urls| with these rules:
714 // 1) Any urls in |icon_urls| which are not already known to the database are
715 // rejected.
716 // Sample new mappings to |page_url|: { ICON_URL1, ICON_URL3 }
717 // 2) If |icon_types| has multiple types, the mappings are only set for the
718 // largest icon type.
719 // Sample new mappings to |page_url|: { ICON_URL3 }
720 // |icon_types| can only have multiple IconTypes if
721 // |icon_types| == TOUCH_ICON | TOUCH_PRECOMPOSED_ICON.
722 // The favicon bitmaps whose edge sizes most closely match |desired_sizes|
723 // from the favicons which were just mapped to |page_url| are returned. If
724 // |desired_sizes| has a '0' entry, the largest favicon bitmap is returned.
725 base::CancelableTaskTracker::TaskId UpdateFaviconMappingsAndFetch( 708 base::CancelableTaskTracker::TaskId UpdateFaviconMappingsAndFetch(
726 const GURL& page_url, 709 const GURL& page_url,
727 const std::vector<GURL>& icon_urls, 710 const GURL& icon_url,
728 int icon_types, 711 favicon_base::IconType icon_type,
729 const std::vector<int>& desired_sizes, 712 const std::vector<int>& desired_sizes,
730 const favicon_base::FaviconResultsCallback& callback, 713 const favicon_base::FaviconResultsCallback& callback,
731 base::CancelableTaskTracker* tracker); 714 base::CancelableTaskTracker* tracker);
732 715
733 // Used by FaviconService to set a favicon for |page_url| and |icon_url| with 716 // Used by FaviconService to set a favicon for |page_url| and |icon_url| with
734 // |pixel_size|. 717 // |pixel_size|.
735 // Example: 718 // Example:
736 // |page_url|: www.google.com 719 // |page_url|: www.google.com
737 // 2 favicons in history for |page_url|: 720 // 2 favicons in history for |page_url|:
738 // www.google.com/a.ico 16x16 721 // www.google.com/a.ico 16x16
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 839
857 // All vended weak pointers are invalidated in Cleanup(). 840 // All vended weak pointers are invalidated in Cleanup().
858 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; 841 base::WeakPtrFactory<HistoryService> weak_ptr_factory_;
859 842
860 DISALLOW_COPY_AND_ASSIGN(HistoryService); 843 DISALLOW_COPY_AND_ASSIGN(HistoryService);
861 }; 844 };
862 845
863 } // namespace history 846 } // namespace history
864 847
865 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ 848 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698