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

Unified Diff: components/dom_distiller/core/viewer.h

Issue 1015463004: Consistent content placement method for dom-distiller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert ios code 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: components/dom_distiller/core/viewer.h
diff --git a/components/dom_distiller/core/viewer.h b/components/dom_distiller/core/viewer.h
index 9e1ded3b26e983f9c6783c0b5be2121a5760e366..0f50fbb5485626b215c3ee0ef6c92767b845d158 100644
--- a/components/dom_distiller/core/viewer.h
+++ b/components/dom_distiller/core/viewer.h
@@ -32,17 +32,22 @@ const std::string GetUnsafeArticleHtml(
const DistilledPagePrefs::Theme theme,
const DistilledPagePrefs::FontFamily font_family);
-// Returns the base Viewer HTML page based on the given |page_proto|. This is
+// Returns an HTML template page based on the given |page_proto| which provides
+// basic information about the page (i.e. title, text direction, etc.). This is
// supposed to be displayed to the end user. The returned HTML should be
// considered unsafe, so callers must ensure rendering it does not compromise
-// Chrome. The difference from |GetUnsafeArticleHtml| is that this can be used
-// for displaying an in-flight distillation instead of waiting for the full
-// article.
-const std::string GetUnsafePartialArticleHtml(
+// Chrome.
+const std::string GetUnsafeArticleTemplateHtml(
const DistilledPageProto* page_proto,
const DistilledPagePrefs::Theme theme,
const DistilledPagePrefs::FontFamily font_family);
+// Returns the JavaScript to place a full article's HTML on the page. The
+// returned HTML should be considered unsafe, so callers must ensure
+// rendering it does not compromise Chrome.
+const std::string GetUnsafeArticleContentJs(
+ const DistilledArticleProto* article_proto);
+
// Returns a JavaScript blob for updating a partial view request with additional
// distilled content. Meant for use when viewing a slow or long multi-page
// article. |is_last_page| indicates whether this is the last page of the
@@ -51,6 +56,10 @@ const std::string GetUnsafeIncrementalDistilledPageJs(
const DistilledPageProto* page_proto,
const bool is_last_page);
+// Returns a JavaScript blob for updating a view request with error page
+// contents.
+const std::string GetErrorPageJs();
+
// Returns a JavaScript blob for controlling the "in-progress" indicator when
// viewing a partially-distilled page. |is_last_page| indicates whether this is
// the last page of the article (i.e. loading indicator should be removed).
« no previous file with comments | « components/dom_distiller/core/html/dom_distiller_viewer.html ('k') | components/dom_distiller/core/viewer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698