diff options
22 files changed, 131 insertions, 9 deletions
diff --git a/chrome/browser/sync/glue/model_association_manager.cc b/chrome/browser/sync/glue/model_association_manager.cc index 7f7536d..3540fd1 100644 --- a/chrome/browser/sync/glue/model_association_manager.cc +++ b/chrome/browser/sync/glue/model_association_manager.cc @@ -36,6 +36,7 @@ static const syncer::ModelType kStartOrder[] = { syncer::TYPED_URLS, syncer::HISTORY_DELETE_DIRECTIVES, syncer::SYNCED_NOTIFICATIONS, + syncer::SYNCED_NOTIFICATION_APP_INFO, // UI thread data types. syncer::BOOKMARKS, diff --git a/chrome/browser/sync/profile_sync_components_factory_impl.cc b/chrome/browser/sync/profile_sync_components_factory_impl.cc index cc5c33c..bfc0fec 100644 --- a/chrome/browser/sync/profile_sync_components_factory_impl.cc +++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc @@ -317,6 +317,8 @@ void ProfileSyncComponentsFactoryImpl::RegisterDesktopDataTypes( new UIDataTypeController( syncer::SYNCED_NOTIFICATIONS, this, profile_, pss)); + // TODO(petewil): Enable the data type controller once we have a handler. + #if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_CHROMEOS) // Dictionary sync is enabled by default. if (!command_line_->HasSwitch(switches::kDisableSyncDictionary)) { diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc index d995a53..80c4d80 100644 --- a/chrome/browser/sync/profile_sync_service.cc +++ b/chrome/browser/sync/profile_sync_service.cc @@ -1602,7 +1602,7 @@ const browser_sync::user_selectable_type::UserSelectableSyncType browser_sync::user_selectable_type::PROXY_TABS }; - COMPILE_ASSERT(31 == syncer::MODEL_TYPE_COUNT, UpdateCustomConfigHistogram); + COMPILE_ASSERT(32 == syncer::MODEL_TYPE_COUNT, UpdateCustomConfigHistogram); if (!sync_everything) { const syncer::ModelTypeSet current_types = GetPreferredDataTypes(); diff --git a/chrome/browser/sync/sync_prefs.cc b/chrome/browser/sync/sync_prefs.cc index ac166ac..eabbf00 100644 --- a/chrome/browser/sync/sync_prefs.cc +++ b/chrome/browser/sync/sync_prefs.cc @@ -325,6 +325,8 @@ const char* SyncPrefs::GetPrefNameForDataType(syncer::ModelType data_type) { return prefs::kSyncHistoryDeleteDirectives; case syncer::SYNCED_NOTIFICATIONS: return prefs::kSyncSyncedNotifications; + case syncer::SYNCED_NOTIFICATION_APP_INFO: + return prefs::kSyncSyncedNotificationAppInfo; case syncer::DICTIONARY: return prefs::kSyncDictionary; case syncer::FAVICON_IMAGES: diff --git a/chrome/browser/sync/test/integration/enable_disable_test.cc b/chrome/browser/sync/test/integration/enable_disable_test.cc index c1ef8a8..23165262 100644 --- a/chrome/browser/sync/test/integration/enable_disable_test.cc +++ b/chrome/browser/sync/test/integration/enable_disable_test.cc @@ -111,7 +111,8 @@ IN_PROC_BROWSER_TEST_F(EnableDisableSingleClientTest, DisableOneAtATime) { it.Good(); it.Inc()) { // MANAGED_USERS is always synced. if (it.Get() == syncer::MANAGED_USERS || - it.Get() == syncer::SYNCED_NOTIFICATIONS) + it.Get() == syncer::SYNCED_NOTIFICATIONS || + it.Get() == syncer::SYNCED_NOTIFICATION_APP_INFO) continue; ASSERT_TRUE(GetClient(0)->DisableSyncForDatatype(it.Get())); diff --git a/chrome/browser/sync/user_selectable_sync_type.h b/chrome/browser/sync/user_selectable_sync_type.h index 5c02372..ce22042 100644 --- a/chrome/browser/sync/user_selectable_sync_type.h +++ b/chrome/browser/sync/user_selectable_sync_type.h @@ -31,6 +31,8 @@ enum UserSelectableSyncType { EXTENSIONS = 6, PROXY_TABS = 7, APPS = 8, + // TODO(petewil): There was talk of removing this from user selectable sync + // types. Should we? SYNCED_NOTIFICATIONS = 9, // The datatypes below are implicitly synced, and are not exposed via user @@ -52,6 +54,7 @@ enum UserSelectableSyncType { // FAVICON_IMAGES, // FAVICON_TRACKING, // ARTICLE, + // SYNCED_NOTIFICATION_APP_INFO // Number of sync datatypes exposed to the user via checboxes in the UI. SELECTABLE_DATATYPE_COUNT = 10, diff --git a/chrome/browser/ui/webui/sync_setup_handler.cc b/chrome/browser/ui/webui/sync_setup_handler.cc index 0c2beb8..1bd655d 100644 --- a/chrome/browser/ui/webui/sync_setup_handler.cc +++ b/chrome/browser/ui/webui/sync_setup_handler.cc @@ -98,7 +98,7 @@ const char* kDataTypeNames[] = { "tabs" }; -COMPILE_ASSERT(31 == syncer::MODEL_TYPE_COUNT, +COMPILE_ASSERT(32 == syncer::MODEL_TYPE_COUNT, update_kDataTypeNames_to_match_UserSelectableTypes); typedef std::map<syncer::ModelType, const char*> ModelTypeNameMap; diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index 57fd8ac..4b59827 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -1811,6 +1811,8 @@ const char kSyncPreferences[] = "sync.preferences"; const char kSyncPriorityPreferences[] = "sync.priority_preferences"; const char kSyncSearchEngines[] = "sync.search_engines"; const char kSyncSessions[] = "sync.sessions"; +const char kSyncSyncedNotificationAppInfo[] = + "sync.synced_notification_app_info"; const char kSyncSyncedNotifications[] = "sync.synced_notifications"; const char kSyncTabs[] = "sync.tabs"; const char kSyncThemes[] = "sync.themes"; diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index 82bb161..02e94f5 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h @@ -614,6 +614,7 @@ extern const char kSyncPreferences[]; extern const char kSyncPriorityPreferences[]; extern const char kSyncSearchEngines[]; extern const char kSyncSessions[]; +extern const char kSyncSyncedNotificationAppInfo[]; extern const char kSyncSyncedNotifications[]; extern const char kSyncTabs[]; extern const char kSyncThemes[]; diff --git a/sync/internal_api/public/base/model_type.h b/sync/internal_api/public/base/model_type.h index 4777be4..dddc617 100644 --- a/sync/internal_api/public/base/model_type.h +++ b/sync/internal_api/public/base/model_type.h @@ -84,6 +84,8 @@ enum ModelType { HISTORY_DELETE_DIRECTIVES, // Synced push notifications. SYNCED_NOTIFICATIONS, + // Synced Notification app info. + SYNCED_NOTIFICATION_APP_INFO, // Custom spelling dictionary. DICTIONARY, // Favicon images. diff --git a/sync/protocol/nigori_specifics.proto b/sync/protocol/nigori_specifics.proto index 87e6c37..407281f 100644 --- a/sync/protocol/nigori_specifics.proto +++ b/sync/protocol/nigori_specifics.proto @@ -55,6 +55,8 @@ message NigoriSpecifics { // thus can't be encrypted. // Synced Notifications need to be consumed by the server (the read flag) // and thus can't be encrypted. + // Synced Notification App Info is set by the server, and thus cannot 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 be639425..cb6c218 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; diff --git a/sync/protocol/proto_value_conversions.h b/sync/protocol/proto_value_conversions.h index 3c8f3d9..d93d5d1 100644 --- a/sync/protocol/proto_value_conversions.h +++ b/sync/protocol/proto_value_conversions.h @@ -64,6 +64,8 @@ class SyncAttachmentId; class SyncCycleCompletedEventInfo; class SyncedNotification; class SyncedNotificationAction; +class SyncedNotificationAppInfo; +class SyncedNotificationAppInfoSpecifics; class SyncedNotificationDestination; class SyncedNotificationImage; class SyncedNotificationProfileImage; @@ -249,6 +251,11 @@ SYNC_EXPORT_PRIVATE base::DictionaryValue* PasswordSpecificsToValue( SYNC_EXPORT_PRIVATE base::DictionaryValue* PreferenceSpecificsToValue( const sync_pb::PreferenceSpecifics& password_specifics); +SYNC_EXPORT_PRIVATE base::DictionaryValue* + SyncedNotificationAppInfoSpecificsToValue( + const sync_pb::SyncedNotificationAppInfoSpecifics& + synced_notification_specifics); + SYNC_EXPORT_PRIVATE base::DictionaryValue* SyncedNotificationSpecificsToValue( const sync_pb::SyncedNotificationSpecifics& synced_notification_specifics); diff --git a/sync/protocol/proto_value_conversions_unittest.cc b/sync/protocol/proto_value_conversions_unittest.cc index 11c9674..dd3a701 100644 --- a/sync/protocol/proto_value_conversions_unittest.cc +++ b/sync/protocol/proto_value_conversions_unittest.cc @@ -55,7 +55,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(31, MODEL_TYPE_COUNT); + EXPECT_EQ(32, 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 @@ -236,6 +236,10 @@ TEST_F(ProtoValueConversionsTest, SessionSpecificsToValue) { TestSpecificsToValue(SessionSpecificsToValue); } +TEST_F(ProtoValueConversionsTest, SyncedNotificationAppInfoSpecificsToValue) { + TestSpecificsToValue(SyncedNotificationAppInfoSpecificsToValue); +} + TEST_F(ProtoValueConversionsTest, SyncedNotificationSpecificsToValue) { TestSpecificsToValue(SyncedNotificationSpecificsToValue); } @@ -290,6 +294,7 @@ TEST_F(ProtoValueConversionsTest, EntitySpecificsToValue) { SET_FIELD(search_engine); SET_FIELD(session); SET_FIELD(synced_notification); + SET_FIELD(synced_notification_app_info); SET_FIELD(theme); SET_FIELD(typed_url); diff --git a/sync/protocol/sync.proto b/sync/protocol/sync.proto index d5fc00c..55bc9b3 100644 --- a/sync/protocol/sync.proto +++ b/sync/protocol/sync.proto @@ -44,6 +44,7 @@ import "priority_preference_specifics.proto"; import "search_engine_specifics.proto"; import "session_specifics.proto"; import "sync_enums.proto"; +import "synced_notification_app_info_specifics.proto"; import "synced_notification_specifics.proto"; import "theme_specifics.proto"; import "typed_url_specifics.proto"; @@ -114,6 +115,8 @@ message EntitySpecifics { optional AppSettingSpecifics app_setting = 103656; optional HistoryDeleteDirectiveSpecifics history_delete_directive = 150251; optional SyncedNotificationSpecifics synced_notification = 153108; + optional SyncedNotificationAppInfoSpecifics synced_notification_app_info = + 235816; optional DeviceInfoSpecifics device_info = 154522; optional ExperimentsSpecifics experiments = 161496; optional PriorityPreferenceSpecifics priority_preference = 163425; diff --git a/sync/protocol/synced_notification_app_info_specifics.proto b/sync/protocol/synced_notification_app_info_specifics.proto new file mode 100644 index 0000000..22bb4d2 --- /dev/null +++ b/sync/protocol/synced_notification_app_info_specifics.proto @@ -0,0 +1,34 @@ +// Copyright 2014 Google Inc. All Rights Reserved. +// +// Sync protocol datatype extension for appInfo objects. + +syntax = "proto2"; + +option optimize_for = LITE_RUNTIME; +option retain_unknown_fields = true; + +package sync_pb; + +import "synced_notification_render.proto"; + +message SyncedNotificationAppInfoSpecifics { + // Information of the list of apps we know about. + // NOTE: This may not be the comprehensive list of apps that send + // notifications. At best, it will contain all the first party apps and + // paging support is not needed. + // This is a static list sent from the server that is read only on the client. + repeated SyncedNotificationAppInfo synced_notification_app_info = 1; +} + +message SyncedNotificationAppInfo { + // The application ID of a subservice within the notification sending service. + repeated string app_id = 1; + + // The name to use in the settings screen for this app. + optional string settings_display_name = 2; + + // The icon to use. The URL of the icon may point to a + // hi-res image, so clients should always size the image to the + // preferred width and height specified in the Image proto. + optional SyncedNotificationImage icon = 3; +}
\ No newline at end of file diff --git a/sync/sync_proto.gypi b/sync/sync_proto.gypi index 5a34c7a..3385317 100644 --- a/sync/sync_proto.gypi +++ b/sync/sync_proto.gypi @@ -41,6 +41,7 @@ 'protocol/session_specifics.proto', 'protocol/sync.proto', 'protocol/sync_enums.proto', + 'protocol/synced_notification_app_info_specifics.proto', 'protocol/synced_notification_data.proto', 'protocol/synced_notification_render.proto', 'protocol/synced_notification_specifics.proto', diff --git a/sync/syncable/model_type.cc b/sync/syncable/model_type.cc index ecc62fe..475358c 100644 --- a/sync/syncable/model_type.cc +++ b/sync/syncable/model_type.cc @@ -86,6 +86,9 @@ void AddDefaultFieldValue(ModelType datatype, case SYNCED_NOTIFICATIONS: specifics->mutable_synced_notification(); break; + case SYNCED_NOTIFICATION_APP_INFO: + specifics->mutable_synced_notification_app_info(); + break; case DEVICE_INFO: specifics->mutable_device_info(); break; @@ -189,6 +192,8 @@ int GetSpecificsFieldNumberFromModelType(ModelType model_type) { return sync_pb::EntitySpecifics::kHistoryDeleteDirectiveFieldNumber; case SYNCED_NOTIFICATIONS: return sync_pb::EntitySpecifics::kSyncedNotificationFieldNumber; + case SYNCED_NOTIFICATION_APP_INFO: + return sync_pb::EntitySpecifics::kSyncedNotificationAppInfoFieldNumber; case DEVICE_INFO: return sync_pb::EntitySpecifics::kDeviceInfoFieldNumber; break; @@ -311,6 +316,9 @@ ModelType GetModelTypeFromSpecifics(const sync_pb::EntitySpecifics& specifics) { if (specifics.has_synced_notification()) return SYNCED_NOTIFICATIONS; + if (specifics.has_synced_notification_app_info()) + return SYNCED_NOTIFICATION_APP_INFO; + if (specifics.has_device_info()) return DEVICE_INFO; @@ -387,6 +395,9 @@ ModelTypeSet EncryptableUserTypes() { encryptable_user_types.Remove(HISTORY_DELETE_DIRECTIVES); // Synced notifications are not encrypted since the server must see changes. encryptable_user_types.Remove(SYNCED_NOTIFICATIONS); + // Synced Notification App Info does not have private data, so it is not + // encrypted. + encryptable_user_types.Remove(SYNCED_NOTIFICATION_APP_INFO); // Priority preferences are not encrypted because they might be synced before // encryption is ready. encryptable_user_types.Remove(PRIORITY_PREFERENCES); @@ -436,6 +447,7 @@ ModelTypeSet CoreTypes() { // The following are low priority core types. result.Put(SYNCED_NOTIFICATIONS); + result.Put(SYNCED_NOTIFICATION_APP_INFO); return result; } @@ -495,6 +507,8 @@ const char* ModelTypeToString(ModelType model_type) { return "History Delete Directives"; case SYNCED_NOTIFICATIONS: return "Synced Notifications"; + case SYNCED_NOTIFICATION_APP_INFO: + return "Synced Notification App Info"; case DEVICE_INFO: return "Device Info"; case EXPERIMENTS: @@ -592,6 +606,8 @@ int ModelTypeToHistogramInt(ModelType model_type) { return 29; case MANAGED_USER_SHARED_SETTINGS: return 30; + case SYNCED_NOTIFICATION_APP_INFO: + return 31; // Silence a compiler warning. case MODEL_TYPE_COUNT: return 0; @@ -663,6 +679,8 @@ ModelType ModelTypeFromString(const std::string& model_type_string) { return HISTORY_DELETE_DIRECTIVES; else if (model_type_string == "Synced Notifications") return SYNCED_NOTIFICATIONS; + else if (model_type_string == "Synced Notification App Info") + return SYNCED_NOTIFICATION_APP_INFO; else if (model_type_string == "Device Info") return DEVICE_INFO; else if (model_type_string == "Experiments") @@ -761,6 +779,8 @@ std::string ModelTypeToRootTag(ModelType type) { return "google_chrome_history_delete_directives"; case SYNCED_NOTIFICATIONS: return "google_chrome_synced_notifications"; + case SYNCED_NOTIFICATION_APP_INFO: + return "google_chrome_synced_notification_app_info"; case DEVICE_INFO: return "google_chrome_device_info"; case EXPERIMENTS: @@ -813,6 +833,7 @@ const char kAppNotificationNotificationType[] = "APP_NOTIFICATION"; const char kHistoryDeleteDirectiveNotificationType[] = "HISTORY_DELETE_DIRECTIVE"; const char kSyncedNotificationType[] = "SYNCED_NOTIFICATION"; +const char kSyncedNotificationAppInfoType[] = "SYNCED_NOTIFICATION_APP_INFO"; const char kDeviceInfoNotificationType[] = "DEVICE_INFO"; const char kExperimentsNotificationType[] = "EXPERIMENTS"; const char kPriorityPreferenceNotificationType[] = "PRIORITY_PREFERENCE"; @@ -883,6 +904,9 @@ bool RealModelTypeToNotificationType(ModelType model_type, case SYNCED_NOTIFICATIONS: *notification_type = kSyncedNotificationType; return true; + case SYNCED_NOTIFICATION_APP_INFO: + *notification_type = kSyncedNotificationAppInfoType; + return true; case DEVICE_INFO: *notification_type = kDeviceInfoNotificationType; return true; @@ -976,6 +1000,9 @@ bool NotificationTypeToRealModelType(const std::string& notification_type, } else if (notification_type == kSyncedNotificationType) { *model_type = SYNCED_NOTIFICATIONS; return true; + } else if (notification_type == kSyncedNotificationAppInfoType) { + *model_type = SYNCED_NOTIFICATION_APP_INFO; + return true; } else if (notification_type == kDeviceInfoNotificationType) { *model_type = DEVICE_INFO; return true; diff --git a/sync/syncable/nigori_util.cc b/sync/syncable/nigori_util.cc index af0545e..f85e325 100644 --- a/sync/syncable/nigori_util.cc +++ b/sync/syncable/nigori_util.cc @@ -242,7 +242,7 @@ void UpdateNigoriFromEncryptedTypes(ModelTypeSet encrypted_types, bool encrypt_everything, sync_pb::NigoriSpecifics* nigori) { nigori->set_encrypt_everything(encrypt_everything); - COMPILE_ASSERT(31 == MODEL_TYPE_COUNT, UpdateEncryptedTypes); + COMPILE_ASSERT(32 == MODEL_TYPE_COUNT, UpdateEncryptedTypes); nigori->set_encrypt_bookmarks( encrypted_types.Has(BOOKMARKS)); nigori->set_encrypt_preferences( @@ -278,7 +278,7 @@ ModelTypeSet GetEncryptedTypesFromNigori( return ModelTypeSet::All(); ModelTypeSet encrypted_types; - COMPILE_ASSERT(31 == MODEL_TYPE_COUNT, UpdateEncryptedTypes); + COMPILE_ASSERT(32 == MODEL_TYPE_COUNT, UpdateEncryptedTypes); if (nigori.encrypt_bookmarks()) encrypted_types.Put(BOOKMARKS); if (nigori.encrypt_preferences()) diff --git a/sync/tools/sync_client.cc b/sync/tools/sync_client.cc index 93b80e0..953df92 100644 --- a/sync/tools/sync_client.cc +++ b/sync/tools/sync_client.cc @@ -309,6 +309,7 @@ int SyncClientMain(int argc, char* argv[]) { model_types.Put(APP_NOTIFICATIONS); model_types.Put(HISTORY_DELETE_DIRECTIVES); model_types.Put(SYNCED_NOTIFICATIONS); + model_types.Put(SYNCED_NOTIFICATION_APP_INFO); model_types.Put(DEVICE_INFO); model_types.Put(EXPERIMENTS); model_types.Put(PRIORITY_PREFERENCES); diff --git a/sync/tools/testserver/chromiumsync.py b/sync/tools/testserver/chromiumsync.py index 79eb114..df47e55 100644 --- a/sync/tools/testserver/chromiumsync.py +++ b/sync/tools/testserver/chromiumsync.py @@ -49,6 +49,7 @@ import search_engine_specifics_pb2 import session_specifics_pb2 import sync_pb2 import sync_enums_pb2 +import synced_notification_app_info_specifics_pb2 import synced_notification_data_pb2 import synced_notification_render_pb2 import synced_notification_specifics_pb2 @@ -84,11 +85,12 @@ ALL_TYPES = ( SEARCH_ENGINE, SESSION, SYNCED_NOTIFICATION, + SYNCED_NOTIFICATION_APP_INFO, THEME, TYPED_URL, EXTENSION_SETTINGS, FAVICON_IMAGES, - FAVICON_TRACKING) = range(29) + FAVICON_TRACKING) = range(30) # An enumeration on the frequency at which the server should send errors # to the client. This would be specified by the url that triggers the error. @@ -132,6 +134,8 @@ SYNC_TYPE_TO_DESCRIPTOR = { SEARCH_ENGINE: SYNC_TYPE_FIELDS['search_engine'], SESSION: SYNC_TYPE_FIELDS['session'], SYNCED_NOTIFICATION: SYNC_TYPE_FIELDS["synced_notification"], + SYNCED_NOTIFICATION_APP_INFO: + SYNC_TYPE_FIELDS["synced_notification_app_info"], THEME: SYNC_TYPE_FIELDS['theme'], TYPED_URL: SYNC_TYPE_FIELDS['typed_url'], } @@ -545,6 +549,9 @@ class SyncDataModel(object): PermanentItem('google_chrome_synced_notifications', name='Synced Notifications', parent_tag=ROOT_ID, sync_type=SYNCED_NOTIFICATION), + PermanentItem('google_chrome_synced_notification_app_info', + name='Synced Notification App Info', + parent_tag=ROOT_ID, sync_type=SYNCED_NOTIFICATION_APP_INFO), PermanentItem('google_chrome_search_engines', name='Search Engines', parent_tag=ROOT_ID, sync_type=SEARCH_ENGINE), PermanentItem('google_chrome_sessions', name='Sessions', @@ -1224,7 +1231,6 @@ class SyncDataModel(object): return specifics - def _CreateSyncedNotificationClientTag(self, key): """Create the client_defined_unique_tag value for a SyncedNotification. @@ -1240,7 +1246,6 @@ class SyncDataModel(object): hash_input = serialized_type.SerializeToString() + key return base64.b64encode(hashlib.sha1(hash_input).digest()) - class TestServer(object): """An object to handle requests for one (and only one) Chrome Sync account. diff --git a/sync/util/data_type_histogram.h b/sync/util/data_type_histogram.h index 11be1ec..e2ab49f 100644 --- a/sync/util/data_type_histogram.h +++ b/sync/util/data_type_histogram.h @@ -90,6 +90,9 @@ case ::syncer::SYNCED_NOTIFICATIONS: \ PER_DATA_TYPE_MACRO("SyncedNotifications"); \ break; \ + case ::syncer::SYNCED_NOTIFICATION_APP_INFO: \ + PER_DATA_TYPE_MACRO("SyncedNotificationAppInfo"); \ + break; \ case ::syncer::DEVICE_INFO: \ PER_DATA_TYPE_MACRO("DeviceInfo"); \ break; \ |