1a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved.
2a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
3a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// found in the LICENSE file.
4a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
5a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include "components/dom_distiller/core/article_distillation_update.h"
6a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
7a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include "base/logging.h"
8a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
9a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)namespace dom_distiller {
10a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
11a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)ArticleDistillationUpdate::ArticleDistillationUpdate(
12a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)    const std::vector<scoped_refptr<RefCountedPageProto> >& pages,
13a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)    bool has_next_page,
14a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)    bool has_prev_page)
15a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)    : has_next_page_(has_next_page),
16a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)      has_prev_page_(has_prev_page),
17a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)      pages_(pages) {}
18a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
19a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)ArticleDistillationUpdate::~ArticleDistillationUpdate() {}
20a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
21a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)const DistilledPageProto& ArticleDistillationUpdate::GetDistilledPage(
22a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)    size_t index) const {
23a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  DCHECK_GT(pages_.size(), index);
24a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  return pages_[index]->data;
25a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)}
26a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
27a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)}  // namespace dom_distiller
28