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

Unified Diff: components/dom_distiller/core/distiller.cc

Issue 678543002: add pagination info to DistilledPageProto (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 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
« no previous file with comments | « no previous file | components/dom_distiller/core/distiller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/core/distiller.cc
diff --git a/components/dom_distiller/core/distiller.cc b/components/dom_distiller/core/distiller.cc
index 3976d8932d02a0088fd9c9a8226151846944275d..b5bd95dab38ade55ca266fccb64b5ea1e5cb8fc2 100644
--- a/components/dom_distiller/core/distiller.cc
+++ b/components/dom_distiller/core/distiller.cc
@@ -177,6 +177,8 @@ void DistillerImpl::OnPageDistillationFinished(
// The pages should be in same origin.
DCHECK_EQ(next_page_url.GetOrigin(), page_url.GetOrigin());
AddToDistillationQueue(page_num + 1, next_page_url);
+ page_data->distilled_page_proto->data.mutable_pagination_info()->
+ set_next_page(next_page_url.spec());
}
}
@@ -185,6 +187,16 @@ void DistillerImpl::OnPageDistillationFinished(
if (prev_page_url.is_valid()) {
DCHECK_EQ(prev_page_url.GetOrigin(), page_url.GetOrigin());
AddToDistillationQueue(page_num - 1, prev_page_url);
+ page_data->distilled_page_proto->data.mutable_pagination_info()->
+ set_prev_page(prev_page_url.spec());
+ }
+ }
+
+ if (pagination_info.has_canonical_page()) {
+ GURL canonical_page_url(pagination_info.canonical_page());
+ if (canonical_page_url.is_valid()) {
+ page_data->distilled_page_proto->data.mutable_pagination_info()->
+ set_canonical_page(canonical_page_url.spec());
}
}
}
« no previous file with comments | « no previous file | components/dom_distiller/core/distiller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698