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

Unified Diff: sync/protocol/proto_value_conversions.cc

Issue 143973006: New Sync datatype for Synced Notifications App Info (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: AppInfo: Fix proto version number and cr comments Created 6 years, 11 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
Index: sync/protocol/proto_value_conversions.cc
diff --git a/sync/protocol/proto_value_conversions.cc b/sync/protocol/proto_value_conversions.cc
index be6394257c259167b7b037e035bb77d5af891277..cb6c2182928944da07de6edca90e50d4ce96dabf 100644
--- a/sync/protocol/proto_value_conversions.cc
+++ b/sync/protocol/proto_value_conversions.cc
@@ -36,6 +36,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_app_info_specifics.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"
@@ -241,6 +242,16 @@ base::DictionaryValue* TimeRangeDirectiveToValue(
return value;
}
+base::DictionaryValue* SyncedNotificationAppInfoToValue(
+ const sync_pb::SyncedNotificationAppInfo& proto) {
+ base::DictionaryValue* value = new base::DictionaryValue();
+ SET_STR_REP(app_id);
+ SET_STR(settings_display_name);
+ SET(icon, SyncedNotificationImageToValue);
+ // TODO(petewil): Add fields for the monochrome icon when it is available.
+ return value;
+}
+
base::DictionaryValue* SyncedNotificationImageToValue(
const sync_pb::SyncedNotificationImage& proto) {
base::DictionaryValue* value = new base::DictionaryValue();
@@ -650,6 +661,13 @@ base::DictionaryValue* PriorityPreferenceSpecificsToValue(
return value;
}
+base::DictionaryValue* SyncedNotificationAppInfoSpecificsToValue(
+ const sync_pb::SyncedNotificationAppInfoSpecifics& proto) {
+ base::DictionaryValue* value = new base::DictionaryValue();
+ SET_REP(synced_notification_app_info, SyncedNotificationAppInfoToValue);
+ return value;
+}
+
base::DictionaryValue* SyncedNotificationSpecificsToValue(
const sync_pb::SyncedNotificationSpecifics& proto) {
// There is a lot of data, for now just use heading, description, key, and
@@ -751,6 +769,8 @@ base::DictionaryValue* EntitySpecificsToValue(
SET_FIELD(search_engine, SearchEngineSpecificsToValue);
SET_FIELD(session, SessionSpecificsToValue);
SET_FIELD(synced_notification, SyncedNotificationSpecificsToValue);
+ SET_FIELD(synced_notification_app_info,
+ SyncedNotificationAppInfoSpecificsToValue);
SET_FIELD(theme, ThemeSpecificsToValue);
SET_FIELD(typed_url, TypedUrlSpecificsToValue);
return value;

Powered by Google App Engine
This is Rietveld 408576698