diff options
author | petewil@chromium.org <petewil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-09 05:37:24 +0000 |
---|---|---|
committer | petewil@chromium.org <petewil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-09 05:37:24 +0000 |
commit | 1ac89bd6244b89243f433044859e765a299f1701 (patch) | |
tree | 68db20615d72c972d5cd6953ae8bbf0753b0f066 /sync/protocol/proto_value_conversions.cc | |
parent | 54484e152c5792fd84445baf1d0a79fbd097d998 (diff) | |
download | chromium_src-1ac89bd6244b89243f433044859e765a299f1701.zip chromium_src-1ac89bd6244b89243f433044859e765a299f1701.tar.gz chromium_src-1ac89bd6244b89243f433044859e765a299f1701.tar.bz2 |
Better S/N logging in the Sync Node Browser
In the Sync Node Browser, we display logging information for each synced
datatype. At the moment, the SyncedNotification datatype doesn't show much
useful information. Add the most useful fields.
BUG=269792
Review URL: https://chromiumcodereview.appspot.com/22648002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216602 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/protocol/proto_value_conversions.cc')
-rw-r--r-- | sync/protocol/proto_value_conversions.cc | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/sync/protocol/proto_value_conversions.cc b/sync/protocol/proto_value_conversions.cc index c145269..21db7b2 100644 --- a/sync/protocol/proto_value_conversions.cc +++ b/sync/protocol/proto_value_conversions.cc @@ -240,8 +240,36 @@ base::DictionaryValue* TimeRangeDirectiveToValue( return value; } -// TODO(petewil): I will need new functions here for the SyncedNotifications -// subtypes. +base::DictionaryValue* SimpleCollapsedLayoutToValue( + const sync_pb::SimpleCollapsedLayout& proto) { + base::DictionaryValue* value = new base::DictionaryValue(); + SET_STR(heading); + SET_STR(description); + return value; +} + +base::DictionaryValue* CollapsedInfoToValue( + const sync_pb::CollapsedInfo& proto) { + base::DictionaryValue* value = new base::DictionaryValue(); + SET(simple_collapsed_layout, SimpleCollapsedLayoutToValue); + return value; +} + +base::DictionaryValue* RenderInfoToValue( + const sync_pb::SyncedNotificationRenderInfo& proto) { + base::DictionaryValue* value = new base::DictionaryValue(); + SET(collapsed_info, CollapsedInfoToValue); + return value; +} + +base::DictionaryValue* CoalescedNotificationToValue( + const sync_pb::CoalescedSyncedNotification& proto) { + base::DictionaryValue* value = new base::DictionaryValue(); + SET_STR(key); + SET_INT32(read_state); + SET(render_info, RenderInfoToValue); + return value; +} base::DictionaryValue* AppNotificationToValue( const sync_pb::AppNotification& proto) { @@ -488,8 +516,11 @@ base::DictionaryValue* PriorityPreferenceSpecificsToValue( base::DictionaryValue* SyncedNotificationSpecificsToValue( const sync_pb::SyncedNotificationSpecifics& proto) { + // There is a lot of data, for now just use heading, description, key, and + // the read state. + // TODO(petewil): Eventually add more data here. base::DictionaryValue* value = new base::DictionaryValue(); - // TODO(petewil): Adjust this once we add actual types in protobuf. + SET(coalesced_notification, CoalescedNotificationToValue); return value; } |