| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_ENTRY_H_ | 5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_ENTRY_H_ |
| 6 #define COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_ENTRY_H_ | 6 #define COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_ENTRY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "components/dom_distiller/core/proto/distilled_article.pb.h" | 10 #include "components/dom_distiller/core/proto/distilled_article.pb.h" |
| 11 #include "sync/api/sync_data.h" | 11 #include "components/sync/api/sync_data.h" |
| 12 #include "sync/protocol/article_specifics.pb.h" | 12 #include "components/sync/protocol/article_specifics.pb.h" |
| 13 #include "sync/protocol/sync.pb.h" | 13 #include "components/sync/protocol/sync.pb.h" |
| 14 | 14 |
| 15 namespace syncer { | 15 namespace syncer { |
| 16 class SyncChange; | 16 class SyncChange; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace dom_distiller { | 19 namespace dom_distiller { |
| 20 | 20 |
| 21 typedef sync_pb::ArticleSpecifics ArticleEntry; | 21 typedef sync_pb::ArticleSpecifics ArticleEntry; |
| 22 typedef sync_pb::ArticlePage ArticleEntryPage; | 22 typedef sync_pb::ArticlePage ArticleEntryPage; |
| 23 | 23 |
| 24 // A valid entry has an entry_id and all its pages have a URL. | 24 // A valid entry has an entry_id and all its pages have a URL. |
| 25 bool IsEntryValid(const ArticleEntry& entry); | 25 bool IsEntryValid(const ArticleEntry& entry); |
| 26 | 26 |
| 27 bool AreEntriesEqual(const ArticleEntry& left, const ArticleEntry& right); | 27 bool AreEntriesEqual(const ArticleEntry& left, const ArticleEntry& right); |
| 28 | 28 |
| 29 sync_pb::EntitySpecifics SpecificsFromEntry(const ArticleEntry& entry); | 29 sync_pb::EntitySpecifics SpecificsFromEntry(const ArticleEntry& entry); |
| 30 ArticleEntry EntryFromSpecifics(const sync_pb::EntitySpecifics& specifics); | 30 ArticleEntry EntryFromSpecifics(const sync_pb::EntitySpecifics& specifics); |
| 31 | 31 |
| 32 ArticleEntry GetEntryFromChange(const syncer::SyncChange& change); | 32 ArticleEntry GetEntryFromChange(const syncer::SyncChange& change); |
| 33 std::string GetEntryIdFromSyncData(const syncer::SyncData& data); | 33 std::string GetEntryIdFromSyncData(const syncer::SyncData& data); |
| 34 syncer::SyncData CreateLocalData(const ArticleEntry& entry); | 34 syncer::SyncData CreateLocalData(const ArticleEntry& entry); |
| 35 | 35 |
| 36 } // namespace dom_distiller | 36 } // namespace dom_distiller |
| 37 | 37 |
| 38 #endif // COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_ENTRY_H_ | 38 #endif // COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_ENTRY_H_ |
| OLD | NEW |