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_
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
{
18 typedef base::RefCountedData
<DistilledPageProto
> RefCountedPageProto
;
20 ArticleDistillationUpdate(
21 const std::vector
<scoped_refptr
<RefCountedPageProto
> >& pages
,
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
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
40 bool HasPrevPage() const { return 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_