| 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 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 Loading... |
| 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 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 697 // Used by the FaviconService to get the favicon bitmap which most closely | 694 // 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 | 695 // matches |desired_size| from the favicon with |favicon_id| from the history |
| 699 // backend. If |desired_size| is 0, the largest favicon bitmap for | 696 // backend. If |desired_size| is 0, the largest favicon bitmap for |
| 700 // |favicon_id| is returned. | 697 // |favicon_id| is returned. |
| 701 base::CancelableTaskTracker::TaskId GetFaviconForID( | 698 base::CancelableTaskTracker::TaskId GetFaviconForID( |
| 702 favicon_base::FaviconID favicon_id, | 699 favicon_base::FaviconID favicon_id, |
| 703 int desired_size, | 700 int desired_size, |
| 704 const favicon_base::FaviconResultsCallback& callback, | 701 const favicon_base::FaviconResultsCallback& callback, |
| 705 base::CancelableTaskTracker* tracker); | 702 base::CancelableTaskTracker* tracker); |
| 706 | 703 |
| 707 // Used by the FaviconService to replace the favicon mappings to |page_url| | 704 // Maps |page_url| to the favicon at |icon_url| if there is an entry in the |
| 708 // for |icon_types| on the history backend. | 705 // database for |icon_url| and |icon_type|. This occurs when there is a |
| 709 // Sample |icon_urls|: | 706 // mapping from a different page URL to |icon_url|. The favicon bitmaps whose |
| 710 // { ICON_URL1 -> TOUCH_ICON, known to the database, | 707 // edge sizes most closely match |desired_sizes| from the favicons which were |
| 711 // ICON_URL2 -> TOUCH_ICON, not known to the database, | 708 // just mapped to |page_url| are returned. If |desired_sizes| has a '0' entry, |
| 712 // ICON_URL3 -> TOUCH_PRECOMPOSED_ICON, known to the database } | 709 // 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( | 710 base::CancelableTaskTracker::TaskId UpdateFaviconMappingsAndFetch( |
| 726 const GURL& page_url, | 711 const GURL& page_url, |
| 727 const std::vector<GURL>& icon_urls, | 712 const GURL& icon_url, |
| 728 int icon_types, | 713 favicon_base::IconType icon_type, |
| 729 const std::vector<int>& desired_sizes, | 714 const std::vector<int>& desired_sizes, |
| 730 const favicon_base::FaviconResultsCallback& callback, | 715 const favicon_base::FaviconResultsCallback& callback, |
| 731 base::CancelableTaskTracker* tracker); | 716 base::CancelableTaskTracker* tracker); |
| 732 | 717 |
| 733 // Used by FaviconService to set a favicon for |page_url| and |icon_url| with | 718 // Used by FaviconService to set a favicon for |page_url| and |icon_url| with |
| 734 // |pixel_size|. | 719 // |pixel_size|. |
| 735 // Example: | 720 // Example: |
| 736 // |page_url|: www.google.com | 721 // |page_url|: www.google.com |
| 737 // 2 favicons in history for |page_url|: | 722 // 2 favicons in history for |page_url|: |
| 738 // www.google.com/a.ico 16x16 | 723 // www.google.com/a.ico 16x16 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 | 841 |
| 857 // All vended weak pointers are invalidated in Cleanup(). | 842 // All vended weak pointers are invalidated in Cleanup(). |
| 858 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; | 843 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; |
| 859 | 844 |
| 860 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 845 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
| 861 }; | 846 }; |
| 862 | 847 |
| 863 } // namespace history | 848 } // namespace history |
| 864 | 849 |
| 865 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ | 850 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ |
| OLD | NEW |