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

Unified Diff: ios/chrome/browser/dom_distiller/distiller_viewer.cc

Issue 2594663005: Report empty article as empty. (Closed)
Patch Set: feedback Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/dom_distiller/distiller_viewer.cc
diff --git a/ios/chrome/browser/dom_distiller/distiller_viewer.cc b/ios/chrome/browser/dom_distiller/distiller_viewer.cc
index a0bd94ab33f1f85bdf72d8163c7e06f943d71308..46a26ab3f414557283108f3ffd69000c9e89fa85 100644
--- a/ios/chrome/browser/dom_distiller/distiller_viewer.cc
+++ b/ios/chrome/browser/dom_distiller/distiller_viewer.cc
@@ -39,13 +39,14 @@ DistillerViewer::~DistillerViewer() {}
void DistillerViewer::OnArticleReady(
const dom_distiller::DistilledArticleProto* article_proto) {
DomDistillerRequestViewBase::OnArticleReady(article_proto);
- if (article_proto->pages_size() > 0) {
+ bool is_empty = article_proto->pages_size() == 0 ||
+ article_proto->pages(0).html().empty();
+ if (!is_empty) {
std::vector<ImageInfo> images;
for (int i = 0; i < article_proto->pages(0).image_size(); i++) {
auto image = article_proto->pages(0).image(i);
images.push_back(ImageInfo{GURL(image.url()), image.data()});
}
-
const std::string html = viewer::GetUnsafeArticleTemplateHtml(
url_.spec(), distilled_page_prefs_->GetTheme(),
distilled_page_prefs_->GetFontFamily());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698