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

Unified Diff: sync/protocol/proto_value_conversions.cc

Issue 12089103: [Sync] Add favicon datatype proto support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 7 years, 10 months 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
« no previous file with comments | « sync/protocol/proto_value_conversions.h ('k') | sync/protocol/proto_value_conversions_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/protocol/proto_value_conversions.cc
diff --git a/sync/protocol/proto_value_conversions.cc b/sync/protocol/proto_value_conversions.cc
index 886d55ab34864cbc340d647132bd95d393ac70da..cb9c12d79e0c041529cfa2829f5d1b1d622e7552 100644
--- a/sync/protocol/proto_value_conversions.cc
+++ b/sync/protocol/proto_value_conversions.cc
@@ -21,6 +21,8 @@
#include "sync/protocol/experiments_specifics.pb.h"
#include "sync/protocol/extension_setting_specifics.pb.h"
#include "sync/protocol/extension_specifics.pb.h"
+#include "sync/protocol/favicon_image_specifics.pb.h"
+#include "sync/protocol/favicon_tracking_specifics.pb.h"
#include "sync/protocol/history_delete_directive_specifics.pb.h"
#include "sync/protocol/nigori_specifics.pb.h"
#include "sync/protocol/password_specifics.pb.h"
@@ -357,6 +359,37 @@ DictionaryValue* ExtensionSpecificsToValue(
return value;
}
+namespace {
+DictionaryValue* FaviconDataToValue(
+ const sync_pb::FaviconData& proto) {
+ DictionaryValue* value = new DictionaryValue();
+ SET_BYTES(favicon);
+ SET_INT32(width);
+ SET_INT32(height);
+ return value;
+}
+} // namespace
+
+DictionaryValue* FaviconImageSpecificsToValue(
+ const sync_pb::FaviconImageSpecifics& proto) {
+ DictionaryValue* value = new DictionaryValue();
+ SET_STR(favicon_url);
+ SET(favicon_web, FaviconDataToValue);
+ SET(favicon_web_32, FaviconDataToValue);
+ SET(favicon_touch_64, FaviconDataToValue);
+ SET(favicon_touch_precomposed_64, FaviconDataToValue);
+ return value;
+}
+
+DictionaryValue* FaviconTrackingSpecificsToValue(
+ const sync_pb::FaviconTrackingSpecifics& proto) {
+ DictionaryValue* value = new DictionaryValue();
+ SET_STR(favicon_url);
+ SET_INT64(last_visit_time_ms)
+ SET_BOOL(is_bookmarked);
+ return value;
+}
+
base::DictionaryValue* HistoryDeleteDirectiveSpecificsToValue(
const sync_pb::HistoryDeleteDirectiveSpecifics& proto) {
DictionaryValue* value = new DictionaryValue();
« no previous file with comments | « sync/protocol/proto_value_conversions.h ('k') | sync/protocol/proto_value_conversions_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698