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

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

Issue 266073003: Add support for distilling current WebContents (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_DOM_DISTILLER_SERVICE_H_ 5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_H_
6 #define COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_H_ 6 #define COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // Use CreateDefaultDistillerPage() to create a default |distiller_page|. 77 // Use CreateDefaultDistillerPage() to create a default |distiller_page|.
78 // The provided |distiller_page| is only used if there is not already a 78 // The provided |distiller_page| is only used if there is not already a
79 // distillation task in progress for the given |url|. 79 // distillation task in progress for the given |url|.
80 virtual scoped_ptr<ViewerHandle> ViewUrl( 80 virtual scoped_ptr<ViewerHandle> ViewUrl(
81 ViewRequestDelegate* delegate, 81 ViewRequestDelegate* delegate,
82 scoped_ptr<DistillerPage> distiller_page, 82 scoped_ptr<DistillerPage> distiller_page,
83 const GURL& url) = 0; 83 const GURL& url) = 0;
84 84
85 // Creates a default DistillerPage. 85 // Creates a default DistillerPage.
86 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPage() = 0; 86 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPage() = 0;
87 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPageWithHandle(
88 scoped_ptr<SourcePageHandle> handle) = 0;
87 89
88 virtual void AddObserver(DomDistillerObserver* observer) = 0; 90 virtual void AddObserver(DomDistillerObserver* observer) = 0;
89 virtual void RemoveObserver(DomDistillerObserver* observer) = 0; 91 virtual void RemoveObserver(DomDistillerObserver* observer) = 0;
90 92
91 protected: 93 protected:
92 DomDistillerServiceInterface() {} 94 DomDistillerServiceInterface() {}
93 95
94 private: 96 private:
95 DISALLOW_COPY_AND_ASSIGN(DomDistillerServiceInterface); 97 DISALLOW_COPY_AND_ASSIGN(DomDistillerServiceInterface);
96 }; 98 };
(...skipping 17 matching lines...) Expand all
114 const std::string& entry_id) OVERRIDE; 116 const std::string& entry_id) OVERRIDE;
115 virtual scoped_ptr<ViewerHandle> ViewEntry( 117 virtual scoped_ptr<ViewerHandle> ViewEntry(
116 ViewRequestDelegate* delegate, 118 ViewRequestDelegate* delegate,
117 scoped_ptr<DistillerPage> distiller_page, 119 scoped_ptr<DistillerPage> distiller_page,
118 const std::string& entry_id) OVERRIDE; 120 const std::string& entry_id) OVERRIDE;
119 virtual scoped_ptr<ViewerHandle> ViewUrl( 121 virtual scoped_ptr<ViewerHandle> ViewUrl(
120 ViewRequestDelegate* delegate, 122 ViewRequestDelegate* delegate,
121 scoped_ptr<DistillerPage> distiller_page, 123 scoped_ptr<DistillerPage> distiller_page,
122 const GURL& url) OVERRIDE; 124 const GURL& url) OVERRIDE;
123 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPage() OVERRIDE; 125 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPage() OVERRIDE;
126 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPageWithHandle(
127 scoped_ptr<SourcePageHandle> handle) OVERRIDE;
124 virtual void AddObserver(DomDistillerObserver* observer) OVERRIDE; 128 virtual void AddObserver(DomDistillerObserver* observer) OVERRIDE;
125 virtual void RemoveObserver(DomDistillerObserver* observer) OVERRIDE; 129 virtual void RemoveObserver(DomDistillerObserver* observer) OVERRIDE;
126 130
127 private: 131 private:
128 void CancelTask(TaskTracker* task); 132 void CancelTask(TaskTracker* task);
129 void AddDistilledPageToList(const ArticleEntry& entry, 133 void AddDistilledPageToList(const ArticleEntry& entry,
130 const DistilledArticleProto* article_proto, 134 const DistilledArticleProto* article_proto,
131 bool distillation_succeeded); 135 bool distillation_succeeded);
132 136
133 TaskTracker* CreateTaskTracker(const ArticleEntry& entry); 137 TaskTracker* CreateTaskTracker(const ArticleEntry& entry);
(...skipping 13 matching lines...) Expand all
147 151
148 typedef ScopedVector<TaskTracker> TaskList; 152 typedef ScopedVector<TaskTracker> TaskList;
149 TaskList tasks_; 153 TaskList tasks_;
150 154
151 DISALLOW_COPY_AND_ASSIGN(DomDistillerService); 155 DISALLOW_COPY_AND_ASSIGN(DomDistillerService);
152 }; 156 };
153 157
154 } // namespace dom_distiller 158 } // namespace dom_distiller
155 159
156 #endif // COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_H_ 160 #endif // COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_H_
OLDNEW
« no previous file with comments | « components/dom_distiller/core/distiller_page.h ('k') | components/dom_distiller/core/dom_distiller_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698