summaryrefslogtreecommitdiffstats
path: root/sync/protocol
diff options
context:
space:
mode:
authorpetewil@chromium.org <petewil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-03 03:22:15 +0000
committerpetewil@chromium.org <petewil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-03 03:22:15 +0000
commita987e6153641b0463a3fa6fca129b227c4f29e71 (patch)
treeda53e4795de09fac8e5d57dbfed5be682c7127a0 /sync/protocol
parent1859cbb22110aadf306c1f832aee7b350faada59 (diff)
downloadchromium_src-a987e6153641b0463a3fa6fca129b227c4f29e71.zip
chromium_src-a987e6153641b0463a3fa6fca129b227c4f29e71.tar.gz
chromium_src-a987e6153641b0463a3fa6fca129b227c4f29e71.tar.bz2
Create a fresh sync datatype for Synced Notifications
BUG=164313 Review URL: https://chromiumcodereview.appspot.com/11441005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174927 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/protocol')
-rw-r--r--sync/protocol/nigori_specifics.proto2
-rw-r--r--sync/protocol/proto_value_conversions.cc12
-rw-r--r--sync/protocol/proto_value_conversions.h5
-rw-r--r--sync/protocol/proto_value_conversions_unittest.cc7
-rw-r--r--sync/protocol/sync.proto2
-rw-r--r--sync/protocol/sync_proto.gyp1
-rw-r--r--sync/protocol/synced_notification_specifics.proto20
7 files changed, 48 insertions, 1 deletions
diff --git a/sync/protocol/nigori_specifics.proto b/sync/protocol/nigori_specifics.proto
index c904783..e591408 100644
--- a/sync/protocol/nigori_specifics.proto
+++ b/sync/protocol/nigori_specifics.proto
@@ -53,6 +53,8 @@ message NigoriSpecifics {
// Passwords are always encrypted, so we don't need a field here.
// History delete directives need to be consumable by the server, and
// thus can't be encrypted.
+ // Synced Notifications need to be consumed by the server (the read flag)
+ // and thus can't be encrypted.
optional bool encrypt_bookmarks = 13;
optional bool encrypt_preferences = 14;
optional bool encrypt_autofill_profile = 15;
diff --git a/sync/protocol/proto_value_conversions.cc b/sync/protocol/proto_value_conversions.cc
index 320ef27..bc486e9 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,13 @@ 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.
+ return value;
+}
+
DictionaryValue* SearchEngineSpecificsToValue(
const sync_pb::SearchEngineSpecifics& proto) {
DictionaryValue* value = new DictionaryValue();
@@ -456,6 +467,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;
diff --git a/sync/protocol/proto_value_conversions.h b/sync/protocol/proto_value_conversions.h
index 5c150ce..a553e56 100644
--- a/sync/protocol/proto_value_conversions.h
+++ b/sync/protocol/proto_value_conversions.h
@@ -49,6 +49,7 @@ class SessionSpecifics;
class SessionTab;
class SessionWindow;
class SyncCycleCompletedEventInfo;
+class SyncedNotificationSpecifics;
class TabNavigation;
class ThemeSpecifics;
class TimeRangeDirective;
@@ -159,6 +160,10 @@ SYNC_EXPORT_PRIVATE base::DictionaryValue* PasswordSpecificsToValue(
SYNC_EXPORT_PRIVATE base::DictionaryValue* PreferenceSpecificsToValue(
const sync_pb::PreferenceSpecifics& password_specifics);
+SYNC_EXPORT_PRIVATE base::DictionaryValue* SyncedNotificationSpecificsToValue(
+ const sync_pb::SyncedNotificationSpecifics&
+ synced_notification_specifics);
+
SYNC_EXPORT_PRIVATE base::DictionaryValue* SearchEngineSpecificsToValue(
const sync_pb::SearchEngineSpecifics& search_engine_specifics);
diff --git a/sync/protocol/proto_value_conversions_unittest.cc b/sync/protocol/proto_value_conversions_unittest.cc
index 642037c..bc4e652 100644
--- a/sync/protocol/proto_value_conversions_unittest.cc
+++ b/sync/protocol/proto_value_conversions_unittest.cc
@@ -49,7 +49,7 @@ TEST_F(ProtoValueConversionsTest, ProtoChangeCheck) {
// If this number changes, that means we added or removed a data
// type. Don't forget to add a unit test for {New
// type}SpecificsToValue below.
- EXPECT_EQ(20, MODEL_TYPE_COUNT);
+ EXPECT_EQ(21, MODEL_TYPE_COUNT);
// We'd also like to check if we changed any field in our messages.
// However, that's hard to do: sizeof could work, but it's
@@ -178,6 +178,10 @@ TEST_F(ProtoValueConversionsTest, SessionSpecificsToValue) {
TestSpecificsToValue(SessionSpecificsToValue);
}
+TEST_F(ProtoValueConversionsTest, SyncedNotificationSpecificsToValue) {
+ TestSpecificsToValue(SyncedNotificationSpecificsToValue);
+}
+
TEST_F(ProtoValueConversionsTest, ThemeSpecificsToValue) {
TestSpecificsToValue(ThemeSpecificsToValue);
}
@@ -210,6 +214,7 @@ TEST_F(ProtoValueConversionsTest, EntitySpecificsToValue) {
SET_FIELD(preference);
SET_FIELD(search_engine);
SET_FIELD(session);
+ SET_FIELD(synced_notification);
SET_FIELD(theme);
SET_FIELD(typed_url);
diff --git a/sync/protocol/sync.proto b/sync/protocol/sync.proto
index ba01725..f8bdd02 100644
--- a/sync/protocol/sync.proto
+++ b/sync/protocol/sync.proto
@@ -34,6 +34,7 @@ import "preference_specifics.proto";
import "search_engine_specifics.proto";
import "session_specifics.proto";
import "sync_enums.proto";
+import "synced_notification_specifics.proto";
import "theme_specifics.proto";
import "typed_url_specifics.proto";
@@ -101,6 +102,7 @@ message EntitySpecifics {
optional ExtensionSettingSpecifics extension_setting = 96159;
optional AppSettingSpecifics app_setting = 103656;
optional HistoryDeleteDirectiveSpecifics history_delete_directive = 150251;
+ optional SyncedNotificationSpecifics synced_notification = 153108;
optional DeviceInfoSpecifics device_info = 154522;
optional ExperimentsSpecifics experiments = 161496;
}
diff --git a/sync/protocol/sync_proto.gyp b/sync/protocol/sync_proto.gyp
index 295e329..8f890f6 100644
--- a/sync/protocol/sync_proto.gyp
+++ b/sync/protocol/sync_proto.gyp
@@ -32,6 +32,7 @@
'session_specifics.proto',
'sync.proto',
'sync_enums.proto',
+ 'synced_notification_specifics.proto',
'test.proto',
'theme_specifics.proto',
'typed_url_specifics.proto',
diff --git a/sync/protocol/synced_notification_specifics.proto b/sync/protocol/synced_notification_specifics.proto
new file mode 100644
index 0000000..db82f52
--- /dev/null
+++ b/sync/protocol/synced_notification_specifics.proto
@@ -0,0 +1,20 @@
+// Copyright (c) 2012 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.
+//
+// Sync protocol datatype extension for synced notifications.
+
+// Update proto_value_conversions{.h,.cc,_unittest.cc} if you change
+// any fields in this file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+option retain_unknown_fields = true;
+
+package sync_pb;
+
+// Properties of SyncedNotificationSpecifics objects.
+message SyncedNotificationSpecifics {
+ // TODO(petewil): this is placeholder data, make a real one
+}