Chromium Code Reviews| Index: chrome/browser/ui/webui/favicon_source.cc |
| diff --git a/chrome/browser/ui/webui/favicon_source.cc b/chrome/browser/ui/webui/favicon_source.cc |
| index 43dd432f1c735f3c907162eed492f86d2e94af4e..f3d2b9027eb60bf9644a5a844a4b0e433273b89e 100644 |
| --- a/chrome/browser/ui/webui/favicon_source.cc |
| +++ b/chrome/browser/ui/webui/favicon_source.cc |
| @@ -58,8 +58,25 @@ void FaviconSource::StartDataRequest(const std::string& path, |
| request_size_map_[request_id] = pixel_size; |
| url = GURL(path.substr(slash + 1)); |
| } else { |
| + // Normally, favicons are fetched for the page currently being viewed. |
| + // The password manager, however, manages passwords for entire domains. |
|
Evan Stade
2012/04/17 21:44:44
this comment should describe the behavior, and a c
Kyle Horimoto
2012/04/17 22:13:38
Done.
|
| + // Each of its URL requests are prefixed with "origin/" to represent that |
| + // the favicon fetched should belong to the domain with an empty path. |
| + if (path.size() > 7 && path.substr(0, 7) == "origin/") { |
| + std::string originalUrl = path.substr(7); |
| + |
| + // If the original URL does not specify a scheme (e.g., example.com |
| + // instead of http://example.com), add "http://" as a default. |
| + if (!GURL(originalUrl).has_scheme()) |
| + originalUrl = "http://" + originalUrl; |
| + |
| + // Strip the path beyond the top-level domain. |
| + url = GURL(originalUrl).GetOrigin(); |
| + } else { |
| + url = GURL(path); |
| + } |
| + |
| request_size_map_[request_id] = 16; |
| - url = GURL(path); |
| } |
| // Intercept requests for prepopulated pages. |