Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Side by Side Diff: components/dom_distiller/core/article_entry.cc

Issue 717793007: Add attachments support to DomDistillerStore (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "components/dom_distiller/core/article_entry.h" 5 #include "components/dom_distiller/core/article_entry.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "components/dom_distiller/core/article_attachments_data.h"
8 #include "sync/api/sync_change.h" 9 #include "sync/api/sync_change.h"
9 10
10 using sync_pb::EntitySpecifics; 11 using sync_pb::EntitySpecifics;
11 using sync_pb::ArticlePage; 12 using sync_pb::ArticlePage;
12 using sync_pb::ArticleSpecifics; 13 using sync_pb::ArticleSpecifics;
13 14
14 namespace dom_distiller { 15 namespace dom_distiller {
15 16
16 bool IsEntryPageValid(const ArticleEntryPage& page) { return page.has_url(); } 17 bool IsEntryPageValid(const ArticleEntryPage& page) { return page.has_url(); }
17 18
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 const EntitySpecifics& entity = data.GetSpecifics(); 57 const EntitySpecifics& entity = data.GetSpecifics();
57 DCHECK(entity.has_article()); 58 DCHECK(entity.has_article());
58 const ArticleSpecifics& specifics = entity.article(); 59 const ArticleSpecifics& specifics = entity.article();
59 DCHECK(specifics.has_entry_id()); 60 DCHECK(specifics.has_entry_id());
60 return specifics.entry_id(); 61 return specifics.entry_id();
61 } 62 }
62 63
63 syncer::SyncData CreateLocalData(const ArticleEntry& entry) { 64 syncer::SyncData CreateLocalData(const ArticleEntry& entry) {
64 EntitySpecifics specifics = SpecificsFromEntry(entry); 65 EntitySpecifics specifics = SpecificsFromEntry(entry);
65 const std::string& entry_id = entry.entry_id(); 66 const std::string& entry_id = entry.entry_id();
66 return syncer::SyncData::CreateLocalData(entry_id, entry_id, specifics); 67 return syncer::SyncData::CreateLocalDataWithAttachments(
68 entry_id, entry_id, specifics, GetAttachmentIds(entry.attachments()));
67 } 69 }
68 70
69 } // namespace dom_distiller 71 } // namespace dom_distiller
OLDNEW
« no previous file with comments | « components/dom_distiller/core/article_entry.h ('k') | components/dom_distiller/core/dom_distiller_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698