OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_DISTILLATION_UPDATE_H_ | |
6 #define COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_DISTILLATION_UPDATE_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "base/memory/ref_counted.h" | |
11 #include "components/dom_distiller/core/proto/distilled_page.pb.h" | |
12 | |
13 namespace dom_distiller { | |
14 | |
15 // Update about an article that is currently under distillation. | |
16 class ArticleDistillationUpdate { | |
17 public: | |
18 typedef scoped_refptr<base::RefCountedData<DistilledPageProto> > | |
19 RefPtrToDistilledPageProto; | |
cjhopman
2014/03/04 02:29:05
How would you feel about just doing:
typedef base
shashi
2014/03/04 19:47:23
Done.
| |
20 | |
21 ArticleDistillationUpdate( | |
22 const std::vector<RefPtrToDistilledPageProto>& pages, | |
23 bool has_next_page, | |
24 bool has_prev_page); | |
25 ~ArticleDistillationUpdate(); | |
26 | |
27 const RefPtrToDistilledPageProto GetDistilledPage(size_t index) const; | |
28 | |
29 size_t GetPagesSize() const { return pages_.size(); } | |
nyquist
2014/03/03 23:00:12
I've mostly seen calls to size() of a local variab
cjhopman
2014/03/04 02:29:05
Yeah, I was tempted to suggest that but it seemed
| |
30 | |
31 bool HasNextPage() const { return has_next_page_; } | |
nyquist
2014/03/03 23:00:12
I think this should be has_next_page, and similarl
cjhopman
2014/03/04 02:29:05
According to the style guide, this is optional.
| |
32 | |
33 bool HasPrevPage() const { return has_prev_page_; } | |
34 | |
35 private: | |
36 // True, if article has a next page. | |
nyquist
2014/03/03 23:00:12
Whether article has a next page. Same below.
Also,
shashi
2014/03/04 19:47:23
Clarified and moved the comments to the public int
| |
37 bool has_next_page_; | |
38 // True, if article has a previous page. | |
39 bool has_prev_page_; | |
40 // Currently available pages. | |
41 std::vector<RefPtrToDistilledPageProto> pages_; | |
42 }; | |
43 | |
44 } // namespace dom_distiller | |
45 | |
46 #endif // COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_DISTILLATION_UPDATE_H_ | |
OLD | NEW |