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

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

Issue 1015463004: Consistent content placement method for dom-distiller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IOS content 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: 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 bf30950290303c6a3d4115fdb5eac1a290cf37f5..e72975aa3465fa45772d4e55e8b9b5da9d0e00ee 100644
--- a/ios/chrome/browser/dom_distiller/distiller_viewer.cc
+++ b/ios/chrome/browser/dom_distiller/distiller_viewer.cc
@@ -38,10 +38,16 @@ DistillerViewer::~DistillerViewer() {
void DistillerViewer::OnArticleReady(
const DistilledArticleProto* article_proto) {
- const std::string html = viewer::GetUnsafeArticleHtml(
- article_proto, distilled_page_prefs_->GetTheme(),
+ const std::string html = viewer::GetUnsafeArticleTemplateHtml(
+ &article_proto->pages(0), distilled_page_prefs_->GetTheme(),
distilled_page_prefs_->GetFontFamily());
+ std::string content_js = viewer::GetUnsafeArticleContentJs(article_proto);
+ // TODO(mdjones): This needs to eventually be placed somewhere better than
+ // after the closing HTML tag.
+ html += "<script>" + content_js + "</script>";
noyau (Ping after 24h) 2015/04/01 11:42:08 This is definitely not the right way to do this.
mdjones 2015/04/01 22:25:33 Done.
+
+
callback_.Run(url_, html);
// No need to hold on to the ViewerHandle now that distillation is complete.

Powered by Google App Engine
This is Rietveld 408576698