Revert "Reland c91b178b07b0d - Delete dead signin code (SigninGlobalError)"
[chromium-blink-merge.git] / components / dom_distiller / core / article_distillation_update.h
blobf6de861f3dacb578cd6689815978380e687acd5c
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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_DISTILLATION_UPDATE_H_
6 #define COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_DISTILLATION_UPDATE_H_
8 #include <vector>
10 #include "base/memory/ref_counted.h"
11 #include "components/dom_distiller/core/proto/distilled_page.pb.h"
13 namespace dom_distiller {
15 // Update about an article that is currently under distillation.
16 class ArticleDistillationUpdate {
17 public:
18 typedef base::RefCountedData<DistilledPageProto> RefCountedPageProto;
20 ArticleDistillationUpdate(
21 const std::vector<scoped_refptr<RefCountedPageProto> >& pages,
22 bool has_next_page,
23 bool has_prev_page);
24 ~ArticleDistillationUpdate();
26 // Returns the distilled page at |index|.
27 const DistilledPageProto& GetDistilledPage(size_t index) const;
29 // Returns the size of distilled pages in this update.
30 size_t GetPagesSize() const { return pages_.size(); }
32 // Returns true, if article has a next page that is currently under
33 // distillation and that is not part of the distilled pages included in this
34 // update.
35 bool HasNextPage() const { return has_next_page_; }
37 // Returns true if article has a previous page that is currently under
38 // distillation and that is not part of the distilled pages included in this
39 // update.
40 bool HasPrevPage() const { return has_prev_page_; }
42 private:
43 bool has_next_page_;
44 bool has_prev_page_;
45 // Currently available pages.
46 std::vector<scoped_refptr<RefCountedPageProto> > pages_;
49 } // namespace dom_distiller
51 #endif // COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_DISTILLATION_UPDATE_H_