Chromium Code Reviews| Index: components/dom_distiller/core/viewer.h |
| diff --git a/components/dom_distiller/core/viewer.h b/components/dom_distiller/core/viewer.h |
| index 61aac1481605c6839512b4173b30b2b2245f467a..bad053f52852bf069cb0431803b15a81969225ad 100644 |
| --- a/components/dom_distiller/core/viewer.h |
| +++ b/components/dom_distiller/core/viewer.h |
| @@ -10,10 +10,12 @@ |
| #include "base/basictypes.h" |
| #include "base/compiler_specific.h" |
| #include "base/memory/scoped_ptr.h" |
| +#include "base/strings/string16.h" |
| namespace dom_distiller { |
| class DistilledArticleProto; |
| +class DistilledPageProto; |
| class DomDistillerServiceInterface; |
| class ViewerHandle; |
| class ViewRequestDelegate; |
| @@ -21,9 +23,30 @@ class ViewRequestDelegate; |
| namespace viewer { |
| // Returns a full HTML page based on the given |article_proto|. This is supposed |
| -// to displayed to the end user. The returned HTML should be considered unsafe, |
| -// so callers must ensure rendering it does not compromise Chrome. |
| -const std::string GetUnsafeHtml(const DistilledArticleProto* article_proto); |
| +// to be displayed to the end user. The returned HTML should be considered |
| +// unsafe, so callers must ensure rendering it does not compromise Chrome. |
| +const std::string GetUnsafeArticleHtml( |
| + const DistilledArticleProto* article_proto); |
| + |
| +// Returns the base Viewer HTML page based on the given |page_proto|. 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( |
| + const DistilledPageProto* page_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. |
| +const std::string GetUnsafeIncrementalDistilledPageJs( |
| + const DistilledPageProto* page_proto, |
| + const bool is_last_page); |
|
nyquist
2014/05/13 05:01:15
Nit: What is |is_last_page| for here and in the me
Yaron
2014/05/14 17:42:33
Done.
|
| + |
| +// Returns a JavaScript blob for controlling the "in-progress" indicator when |
| +// viewing a partially-distilled page. |
| +const std::string GetToggleLoadingIndicatorJs(const bool is_last_page); |
| // Returns a full HTML page which displays a generic error. |
| const std::string GetErrorPageHtml(); |
| @@ -31,6 +54,9 @@ const std::string GetErrorPageHtml(); |
| // Returns the default CSS to be used for a viewer. |
| const std::string GetCss(); |
| +// Returns the default JS to be used for a viewer. |
| +const std::string GetJavaScript(); |
| + |
| // Based on the given path, calls into the DomDistillerServiceInterface for |
| // viewing distilled content based on the |path|. |
| scoped_ptr<ViewerHandle> CreateViewRequest( |