article_distillation_update.cc 924 B

123456789101112131415161718192021222324252627282930
  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. #include "components/dom_distiller/core/article_distillation_update.h"
  5. #include "base/check_op.h"
  6. namespace dom_distiller {
  7. ArticleDistillationUpdate::ArticleDistillationUpdate(
  8. const std::vector<scoped_refptr<RefCountedPageProto>>& pages,
  9. bool has_next_page,
  10. bool has_prev_page)
  11. : has_next_page_(has_next_page),
  12. has_prev_page_(has_prev_page),
  13. pages_(pages) {}
  14. ArticleDistillationUpdate::ArticleDistillationUpdate(
  15. const ArticleDistillationUpdate& other) = default;
  16. ArticleDistillationUpdate::~ArticleDistillationUpdate() {}
  17. const DistilledPageProto& ArticleDistillationUpdate::GetDistilledPage(
  18. size_t index) const {
  19. DCHECK_GT(pages_.size(), index);
  20. return pages_[index]->data;
  21. }
  22. } // namespace dom_distiller