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

Unified Diff: sync/protocol/proto_value_conversions.cc

Issue 11441005: Create a fresh sync datatype for Synced Notifications (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: few last CR comments, fix sync_invalidation_tests Created 8 years 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: sync/protocol/proto_value_conversions.cc
diff --git a/sync/protocol/proto_value_conversions.cc b/sync/protocol/proto_value_conversions.cc
index 320ef27bda81f462a3142e6c3054344062f40ced..352f0cf51b7f70af388156ad9ddf9d5baf128e16 100644
--- a/sync/protocol/proto_value_conversions.cc
+++ b/sync/protocol/proto_value_conversions.cc
@@ -28,6 +28,7 @@
#include "sync/protocol/search_engine_specifics.pb.h"
#include "sync/protocol/session_specifics.pb.h"
#include "sync/protocol/sync.pb.h"
+#include "sync/protocol/synced_notification_specifics.pb.h"
#include "sync/protocol/theme_specifics.pb.h"
#include "sync/protocol/typed_url_specifics.pb.h"
@@ -220,6 +221,9 @@ base::DictionaryValue* TimeRangeDirectiveToValue(
return value;
}
+// TODO(petewil): I will need new functions here for the SyncedNotifications
+// subtypes.
+
DictionaryValue* AppNotificationToValue(
const sync_pb::AppNotification& proto) {
DictionaryValue* value = new DictionaryValue();
@@ -383,6 +387,15 @@ DictionaryValue* PreferenceSpecificsToValue(
return value;
}
+DictionaryValue* SyncedNotificationSpecificsToValue(
+ const sync_pb::SyncedNotificationSpecifics& proto) {
+ DictionaryValue* value = new DictionaryValue();
+ // TODO(petewil): Adjust this once we add actual types in protobuf.
+ SET_STR(name);
+ SET_STR(value);
+ return value;
+}
+
DictionaryValue* SearchEngineSpecificsToValue(
const sync_pb::SearchEngineSpecifics& proto) {
DictionaryValue* value = new DictionaryValue();
@@ -456,6 +469,7 @@ DictionaryValue* EntitySpecificsToValue(
SET_FIELD(preference, PreferenceSpecificsToValue);
SET_FIELD(search_engine, SearchEngineSpecificsToValue);
SET_FIELD(session, SessionSpecificsToValue);
+ SET_FIELD(synced_notification, SyncedNotificationSpecificsToValue);
SET_FIELD(theme, ThemeSpecificsToValue);
SET_FIELD(typed_url, TypedUrlSpecificsToValue);
return value;

Powered by Google App Engine
This is Rietveld 408576698