Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Unified Diff: chrome/common/favicon/fallback_icon_url_parser.cc

Issue 1010783002: [Icons NTP] Working prototype to fetch, store, and display big icons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweaks and unit test fix. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/favicon/fallback_icon_url_parser.cc
diff --git a/chrome/common/favicon/fallback_icon_url_parser.cc b/chrome/common/favicon/fallback_icon_url_parser.cc
index 5a407c6bbb9aa068d2efda8efef1129c9c99a563..f91e39f6450d370b81c12160dd4d673306524b99 100644
--- a/chrome/common/favicon/fallback_icon_url_parser.cc
+++ b/chrome/common/favicon/fallback_icon_url_parser.cc
@@ -54,10 +54,15 @@ bool ParsedFallbackIconPath::Parse(const std::string& path) {
if (!ParseSpecs(spec_str, &size_in_pixels_, &style_))
return false; // Parse failed.
- // Extract URL, which may be empty (if first slash appears at the end).
- std::string url_str = path.substr(slash + 1);
- url_ = GURL(url_str);
- return url_str.empty() || url_.is_valid(); // Allow empty URL.
+ // Need to store the index of the URL field, so Instant Extended can translate
+ // fallback icon URLs using advanced parameters.
+ // Example:
+ // "chrome-search://fallback-icon/48/<renderer-id>/<most-visited-id>"
+ // would be translated to:
+ // "chrome-search://fallback-icon/48/<most-visited-item-with-given-id>".
+ path_index_ = slash + 1;
+ url_string_ = path.substr(path_index_);
+ return true;
}
// static
« no previous file with comments | « chrome/common/favicon/fallback_icon_url_parser.h ('k') | chrome/common/favicon/fallback_icon_url_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698