OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_FAVICON_FAVICON_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ |
6 #define CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ | 6 #define CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
75 // page that has been browsed in the past. |expired| in the callback is | 75 // page that has been browsed in the past. |expired| in the callback is |
76 // always false. | 76 // always false. |
77 Handle GetFaviconForURL(const GURL& page_url, | 77 Handle GetFaviconForURL(const GURL& page_url, |
78 int icon_types, | 78 int icon_types, |
79 CancelableRequestConsumerBase* consumer, | 79 CancelableRequestConsumerBase* consumer, |
80 const FaviconDataCallback& callback); | 80 const FaviconDataCallback& callback); |
81 | 81 |
82 // Marks all types of favicon for the page as being out of date. | 82 // Marks all types of favicon for the page as being out of date. |
83 void SetFaviconOutOfDateForPage(const GURL& page_url); | 83 void SetFaviconOutOfDateForPage(const GURL& page_url); |
84 | 84 |
85 // Clone a favicon from an existing page. This associates the favicon from | |
sky
2011/11/16 17:26:00
Clarify this clones all icons, not just the favico
groby-ooo-7-16
2011/11/17 00:37:55
Done.
| |
86 // |old_page_url| with |new_page_url|, provided |new_page_url| has no | |
87 // recorded association. | |
88 // Needed if you want to declare favicons (tentatively) in advance, before a | |
89 // page is ever visited. | |
90 void CloneFavicon(const GURL& old_page_url, const GURL& new_page_url); | |
sky
2011/11/16 17:26:00
This is worrisome. There's nothing stopping someon
groby-ooo-7-16
2011/11/17 00:37:55
I'm confused - how is that any more of a security
sky
2011/11/17 04:49:01
I wasn't worried about the attack risk (as you say
| |
91 | |
85 // Allows the importer to set many favicons for many pages at once. The pages | 92 // Allows the importer to set many favicons for many pages at once. The pages |
86 // must exist, any favicon sets for unknown pages will be discarded. Existing | 93 // must exist, any favicon sets for unknown pages will be discarded. Existing |
87 // favicons will not be overwritten. | 94 // favicons will not be overwritten. |
88 void SetImportedFavicons( | 95 void SetImportedFavicons( |
89 const std::vector<history::ImportedFaviconUsage>& favicon_usage); | 96 const std::vector<history::ImportedFaviconUsage>& favicon_usage); |
90 | 97 |
91 // Sets the favicon for a page. | 98 // Sets the favicon for a page. |
92 void SetFavicon(const GURL& page_url, | 99 void SetFavicon(const GURL& page_url, |
93 const GURL& icon_url, | 100 const GURL& icon_url, |
94 const std::vector<unsigned char>& image_data, | 101 const std::vector<unsigned char>& image_data, |
95 history::IconType icon_type); | 102 history::IconType icon_type); |
96 | 103 |
97 private: | 104 private: |
98 | 105 |
99 | 106 |
100 Profile* profile_; | 107 Profile* profile_; |
101 | 108 |
102 // Helper to forward an empty result if we cannot get the history service. | 109 // Helper to forward an empty result if we cannot get the history service. |
103 void ForwardEmptyResultAsync(GetFaviconRequest* request); | 110 void ForwardEmptyResultAsync(GetFaviconRequest* request); |
104 | 111 |
105 DISALLOW_COPY_AND_ASSIGN(FaviconService); | 112 DISALLOW_COPY_AND_ASSIGN(FaviconService); |
106 }; | 113 }; |
107 | 114 |
108 #endif // CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ | 115 #endif // CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ |
OLD | NEW |