Index: chrome/browser/sync/syncable/model_type.cc |
diff --git a/chrome/browser/sync/syncable/model_type.cc b/chrome/browser/sync/syncable/model_type.cc |
index bb1de93a45c50547fd2e99447f2bc0314a9d3f21..5a06be84d43d53fd87f7a1e33b421bb636c1f3f5 100644 |
--- a/chrome/browser/sync/syncable/model_type.cc |
+++ b/chrome/browser/sync/syncable/model_type.cc |
@@ -12,6 +12,7 @@ |
#include "chrome/browser/sync/protocol/nigori_specifics.pb.h" |
#include "chrome/browser/sync/protocol/password_specifics.pb.h" |
#include "chrome/browser/sync/protocol/preference_specifics.pb.h" |
+#include "chrome/browser/sync/protocol/session_specifics.pb.h" |
#include "chrome/browser/sync/protocol/sync.pb.h" |
#include "chrome/browser/sync/protocol/theme_specifics.pb.h" |
#include "chrome/browser/sync/protocol/typed_url_specifics.pb.h" |
@@ -45,6 +46,9 @@ void AddDefaultExtensionValue(syncable::ModelType datatype, |
case NIGORI: |
specifics->MutableExtension(sync_pb::nigori); |
break; |
+ case SESSIONS: |
+ specifics->MutableExtension(sync_pb::session); |
+ break; |
case APPS: |
specifics->MutableExtension(sync_pb::app); |
break; |
@@ -112,6 +116,9 @@ ModelType GetModelTypeFromSpecifics(const sync_pb::EntitySpecifics& specifics) { |
if (specifics.HasExtension(sync_pb::app)) |
return APPS; |
+ if (specifics.HasExtension(sync_pb::session)) |
+ return SESSIONS; |
+ |
return UNSPECIFIED; |
} |
@@ -133,6 +140,8 @@ std::string ModelTypeToString(ModelType model_type) { |
return "Extensions"; |
case NIGORI: |
return "Encryption keys"; |
+ case SESSIONS: |
+ return "Sessions"; |
case APPS: |
return "Apps"; |
default: |
@@ -153,6 +162,7 @@ const char kTypedUrlNotificationType[] = "TYPED_URL"; |
const char kExtensionNotificationType[] = "EXTENSION"; |
const char kNigoriNotificationType[] = "NIGORI"; |
const char kAppNotificationType[] = "APP"; |
+const char kSessionNotificationType[] = "SESSION"; |
// TODO(akalin): This is a hack to make new sync data types work with |
// server-issued notifications. Remove this when it's not needed |
// anymore. |
@@ -189,6 +199,9 @@ bool RealModelTypeToNotificationType(ModelType model_type, |
case APPS: |
*notification_type = kAppNotificationType; |
return true; |
+ case SESSIONS: |
+ *notification_type = kSessionNotificationType; |
+ return true; |
// TODO(akalin): This is a hack to make new sync data types work with |
// server-issued notifications. Remove this when it's not needed |
// anymore. |
@@ -231,7 +244,11 @@ bool NotificationTypeToRealModelType(const std::string& notification_type, |
} else if (notification_type == kAppNotificationType) { |
*model_type = APPS; |
return true; |
- } else if (notification_type == kUnknownNotificationType) { |
+ } else if (notification_type == kSessionNotificationType) { |
+ *model_type = SESSIONS; |
+ return true; |
+ } |
+ else if (notification_type == kUnknownNotificationType) { |
// TODO(akalin): This is a hack to make new sync data types work with |
// server-issued notifications. Remove this when it's not needed |
// anymore. |