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

Unified Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2529283002: Save favicon during reading list distillation (Closed)
Patch Set: Add a comment Created 4 years, 1 month 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
« ios/web/public/favicon_url.cc ('K') | « ios/web/public/favicon_url.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_web_controller.mm
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index daba52a1871c7d98c800ef12efd9cc37c4478fbd..2f5fa82090f3f646a6f9a6753ad48d134d5ebd40 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -2807,32 +2807,13 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
DLOG(WARNING) << "JS message parameter not found: favicons";
return NO;
}
+
std::vector<web::FaviconURL> urls;
- for (size_t fav_idx = 0; fav_idx != favicons->GetSize(); ++fav_idx) {
- base::DictionaryValue* favicon = nullptr;
- if (!favicons->GetDictionary(fav_idx, &favicon))
- return NO;
- std::string href;
- std::string rel;
- if (!favicon->GetString("href", &href)) {
- DLOG(WARNING) << "JS message parameter not found: href";
- return NO;
- }
- if (!favicon->GetString("rel", &rel)) {
- DLOG(WARNING) << "JS message parameter not found: rel";
- return NO;
- }
- web::FaviconURL::IconType icon_type = web::FaviconURL::FAVICON;
- if (rel == "apple-touch-icon")
- icon_type = web::FaviconURL::TOUCH_ICON;
- else if (rel == "apple-touch-icon-precomposed")
- icon_type = web::FaviconURL::TOUCH_PRECOMPOSED_ICON;
- urls.push_back(
- web::FaviconURL(GURL(href), icon_type, std::vector<gfx::Size>()));
- }
- if (!urls.empty())
+ bool extraction_result = ExtractFaviconURL(favicons, urls);
+
+ if (extraction_result && !urls.empty())
_webStateImpl->OnFaviconUrlUpdated(urls);
- return YES;
+ return extraction_result;
}
- (BOOL)handleDocumentSubmitMessage:(base::DictionaryValue*)message
« ios/web/public/favicon_url.cc ('K') | « ios/web/public/favicon_url.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698