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..b95e6a4b7e326ff48b98ab11442de03c901c84f4 100644 |
| --- a/chrome/browser/ui/webui/favicon_source.cc |
| +++ b/chrome/browser/ui/webui/favicon_source.cc |
| @@ -58,8 +58,21 @@ void FaviconSource::StartDataRequest(const std::string& path, |
| request_size_map_[request_id] = pixel_size; |
| url = GURL(path.substr(slash + 1)); |
| } else { |
| + if (path.size() > 10 && path.substr(0, 10) == "normalize/") { |
|
Evan Stade
2012/04/14 00:32:43
why isn't this normalization just the default?
Kyle Horimoto
2012/04/16 19:08:15
Essentially, any page can have its own favicon (e.
Evan Stade
2012/04/16 20:45:18
in this case I would not call it "normalize", but
Kyle Horimoto
2012/04/17 21:37:39
Done.
|
| + std::string originalUrl = path.substr(10); |
| + |
| + // If the original URL does not specify a scheme (e.g., example.com |
| + // instead of http://example.com), add "http://" as a default. |
| + if (originalUrl.find("://") == std::string::npos) |
|
Evan Stade
2012/04/14 00:32:43
probably safest to use GURL for this (it has compl
Kyle Horimoto
2012/04/16 19:08:15
Done.
|
| + 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. |