1// Copyright 2013 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_ENTRY_H_ 6#define COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_ENTRY_H_ 7 8#include <string> 9 10#include "sync/api/sync_data.h" 11#include "sync/protocol/article_specifics.pb.h" 12#include "sync/protocol/sync.pb.h" 13 14namespace syncer { 15class SyncChange; 16} 17 18namespace dom_distiller { 19 20typedef sync_pb::ArticleSpecifics ArticleEntry; 21typedef sync_pb::ArticlePage ArticleEntryPage; 22 23// A valid entry has an entry_id and all its pages have a URL. 24bool IsEntryValid(const ArticleEntry& entry); 25 26bool AreEntriesEqual(const ArticleEntry& left, const ArticleEntry& right); 27 28sync_pb::EntitySpecifics SpecificsFromEntry(const ArticleEntry& entry); 29ArticleEntry EntryFromSpecifics(const sync_pb::EntitySpecifics& specifics); 30 31ArticleEntry GetEntryFromChange(const syncer::SyncChange& change); 32std::string GetEntryIdFromSyncData(const syncer::SyncData& data); 33syncer::SyncData CreateLocalData(const ArticleEntry& entry); 34 35} // namespace dom_distiller 36 37#endif // COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_ENTRY_H_ 38