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

Side by Side Diff: components/dom_distiller/core/viewer.h

Issue 260073009: [dom_distiller] Add support for incremental viewer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_VIEWER_H_ 5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_VIEWER_H_
6 #define COMPONENTS_DOM_DISTILLER_CORE_VIEWER_H_ 6 #define COMPONENTS_DOM_DISTILLER_CORE_VIEWER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/strings/string16.h"
13 14
14 namespace dom_distiller { 15 namespace dom_distiller {
15 16
16 class DistilledArticleProto; 17 class DistilledArticleProto;
18 class DistilledPageProto;
17 class DomDistillerServiceInterface; 19 class DomDistillerServiceInterface;
18 class ViewerHandle; 20 class ViewerHandle;
19 class ViewRequestDelegate; 21 class ViewRequestDelegate;
20 22
21 namespace viewer { 23 namespace viewer {
22 24
23 // Returns a full HTML page based on the given |article_proto|. This is supposed 25 // Returns a full HTML page based on the given |article_proto|. This is supposed
24 // to displayed to the end user. The returned HTML should be considered unsafe, 26 // to displayed to the end user. The returned HTML should be considered unsafe,
25 // so callers must ensure rendering it does not compromise Chrome. 27 // so callers must ensure rendering it does not compromise Chrome.
26 const std::string GetUnsafeHtml(const DistilledArticleProto* article_proto); 28 const std::string GetUnsafeArticleHtml(
29 const DistilledArticleProto* article_proto);
30
31 const std::string GetUnsafePartialArticleHtml(
32 const DistilledPageProto* page_proto);
33
34 const base::string16 GetUnsafeIncrementalDistilledPageJs(
35 const DistilledPageProto* page_proto,
36 const bool is_last_page);
37
38 const base::string16 GetToggleLoadingIndicatorJs(const bool is_last_page);
27 39
28 // Returns a full HTML page which displays a generic error. 40 // Returns a full HTML page which displays a generic error.
29 const std::string GetErrorPageHtml(); 41 const std::string GetErrorPageHtml();
30 42
31 // Returns the default CSS to be used for a viewer. 43 // Returns the default CSS to be used for a viewer.
32 const std::string GetCss(); 44 const std::string GetCss();
33 45
46 const std::string GetJavaScript();
47
34 // Based on the given path, calls into the DomDistillerServiceInterface for 48 // Based on the given path, calls into the DomDistillerServiceInterface for
35 // viewing distilled content based on the |path|. 49 // viewing distilled content based on the |path|.
36 scoped_ptr<ViewerHandle> CreateViewRequest( 50 scoped_ptr<ViewerHandle> CreateViewRequest(
37 DomDistillerServiceInterface* dom_distiller_service, 51 DomDistillerServiceInterface* dom_distiller_service,
38 const std::string& path, 52 const std::string& path,
39 ViewRequestDelegate* view_request_delegate); 53 ViewRequestDelegate* view_request_delegate);
40 54
41 } // namespace viewer 55 } // namespace viewer
42 56
43 } // namespace dom_distiller 57 } // namespace dom_distiller
44 58
45 #endif // COMPONENTS_DOM_DISTILLER_CORE_VIEWER_H_ 59 #endif // COMPONENTS_DOM_DISTILLER_CORE_VIEWER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698