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_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 // returned in the priority of TOUCH_PRECOMPOSED_ICON, TOUCH_ICON, and | 683 // returned in the priority of TOUCH_PRECOMPOSED_ICON, TOUCH_ICON, and |
684 // FAVICON. | 684 // FAVICON. |
685 CancelableTaskTracker::TaskId GetFavicons( | 685 CancelableTaskTracker::TaskId GetFavicons( |
686 const std::vector<GURL>& icon_urls, | 686 const std::vector<GURL>& icon_urls, |
687 int icon_types, | 687 int icon_types, |
688 int desired_size_in_dip, | 688 int desired_size_in_dip, |
689 const std::vector<ui::ScaleFactor>& desired_scale_factors, | 689 const std::vector<ui::ScaleFactor>& desired_scale_factors, |
690 const FaviconService::FaviconResultsCallback& callback, | 690 const FaviconService::FaviconResultsCallback& callback, |
691 CancelableTaskTracker* tracker); | 691 CancelableTaskTracker* tracker); |
692 | 692 |
693 // Used by the FaviconService to get favicons mapped to |page_url| for | 693 // Used by the FaviconService to get favicons mapped to |params.page_url| for |
694 // |icon_types| which most closely match |desired_size_in_dip| and | 694 // icon_types in |params.icon_types| which most closely match |
695 // |desired_scale_factors|. If |desired_size_in_dip| is 0, the largest favicon | 695 // |params.desired_size_in_dip| and |desired_scale_factors|. |
696 // bitmap for |icon_types| is returned. The returned FaviconBitmapResults will | 696 // If |desired_size_in_dip| is 0, the largest favicon bitmap for |
| 697 // |params.icon_types| is returned. The returned FaviconBitmapResults will |
697 // have at most one result for each of |desired_scale_factors|. If a favicon | 698 // have at most one result for each of |desired_scale_factors|. If a favicon |
698 // bitmap is determined to be the best candidate for multiple scale factors | 699 // bitmap is determined to be the best candidate for multiple scale factors |
699 // there will be less results. If |icon_types| has several types, results for | 700 // there will be less results. |
| 701 // |params.icon_types| is a list of icon_type composition and defines the |
| 702 // prefered icon types in priority. |
| 703 // If it has only one element, and this element has several types, results for |
700 // only a single type will be returned in the priority of | 704 // only a single type will be returned in the priority of |
701 // TOUCH_PRECOMPOSED_ICON, TOUCH_ICON, and FAVICON. | 705 // TOUCH_PRECOMPOSED_ICON, TOUCH_ICON, and FAVICON. |
| 706 // if it has more than one element, there is only one icon returned by below |
| 707 // rule: |
| 708 // Among all icons found by |params.desired_size_in_dip| and |
| 709 // |desired_scal_factors|, the largest icon of first types given by |
| 710 // |params.icon_types| is returned, if its size is larger than |
| 711 // |params.threshold_for_next_icon_types|; otherwise, find the largest one |
| 712 // in next icon types in |params.icon_types| and so on. |
| 713 // If none icon is larger than |threshold_for_next_icon_types|, the largest |
| 714 // one among all found icon is returned. |
| 715 // This feature is especially useful when some types of icon is perfered as |
| 716 // long as its size is larger than a specific value. |
702 CancelableTaskTracker::TaskId GetFaviconsForURL( | 717 CancelableTaskTracker::TaskId GetFaviconsForURL( |
703 const GURL& page_url, | 718 const FaviconService::FaviconForURLParams& params, |
704 int icon_types, | |
705 int desired_size_in_dip, | |
706 const std::vector<ui::ScaleFactor>& desired_scale_factors, | 719 const std::vector<ui::ScaleFactor>& desired_scale_factors, |
707 const FaviconService::FaviconResultsCallback& callback, | 720 const FaviconService::FaviconResultsCallback& callback, |
708 CancelableTaskTracker* tracker); | 721 CancelableTaskTracker* tracker); |
709 | 722 |
710 // Used by the FaviconService to get the favicon bitmap which most closely | 723 // Used by the FaviconService to get the favicon bitmap which most closely |
711 // matches |desired_size_in_dip| and |desired_scale_factor| from the favicon | 724 // matches |desired_size_in_dip| and |desired_scale_factor| from the favicon |
712 // with |favicon_id| from the history backend. If |desired_size_in_dip| is 0, | 725 // with |favicon_id| from the history backend. If |desired_size_in_dip| is 0, |
713 // the largest favicon bitmap for |favicon_id| is returned. | 726 // the largest favicon bitmap for |favicon_id| is returned. |
714 CancelableTaskTracker::TaskId GetFaviconForID( | 727 CancelableTaskTracker::TaskId GetFaviconForID( |
715 chrome::FaviconID favicon_id, | 728 chrome::FaviconID favicon_id, |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; | 1076 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; |
1064 | 1077 |
1065 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; | 1078 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; |
1066 | 1079 |
1067 history::DeleteDirectiveHandler delete_directive_handler_; | 1080 history::DeleteDirectiveHandler delete_directive_handler_; |
1068 | 1081 |
1069 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 1082 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
1070 }; | 1083 }; |
1071 | 1084 |
1072 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 1085 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
OLD | NEW |