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

Unified Diff: components/dom_distiller/core/article_attachments_data.h

Issue 717793007: Add attachments support to DomDistillerStore (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move some unrelated stuff out 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 side-by-side diff with in-line comments
Download patch
Index: components/dom_distiller/core/article_attachments_data.h
diff --git a/components/dom_distiller/core/article_attachments_data.h b/components/dom_distiller/core/article_attachments_data.h
new file mode 100644
index 0000000000000000000000000000000000000000..be3e72c7a8f9227f1bd0f66eb989034649f1357d
--- /dev/null
+++ b/components/dom_distiller/core/article_attachments_data.h
@@ -0,0 +1,45 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_ATTACHMENTS_DATA_H_
+#define COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_ATTACHMENTS_DATA_H_
+
+#include <string>
+
+#include "base/memory/scoped_ptr.h"
+#include "components/dom_distiller/core/proto/distilled_article.pb.h"
+#include "sync/api/attachments/attachment.h"
+#include "sync/protocol/article_specifics.pb.h"
+
+namespace dom_distiller {
+
+class ArticleAttachmentsData {
maniscalco 2014/11/12 18:59:43 How should I think about this class? Is it essent
cjhopman 2014/11/14 02:45:15 I've documented it a bit. Let me know if that does
+ public:
+ static scoped_ptr<ArticleAttachmentsData> GetFromAttachmentMap(
+ const sync_pb::ArticleAttachments& attachments_key,
+ const syncer::AttachmentMap& attachment_map);
+
+ std::string ToString() const;
+
+ void CreateSyncAttachments(
+ syncer::AttachmentList* attachment_list,
+ sync_pb::ArticleAttachments* attachments_key) const;
+
+ const DistilledArticleProto& distilled_article() const {
+ return distilled_article_;
+ }
+ void set_distilled_article(const DistilledArticleProto& article) {
+ distilled_article_ = article;
+ }
+
+ private:
+ DistilledArticleProto distilled_article_;
+};
+
+syncer::AttachmentIdList GetAttachmentIds(
+ const sync_pb::ArticleAttachments& attachments);
+
+} // namespace dom_distiller
+
+#endif
maniscalco 2014/11/12 18:59:43 nit: // COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_ATT
cjhopman 2014/11/14 02:45:15 Done.

Powered by Google App Engine
This is Rietveld 408576698