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

Unified Diff: chrome/browser/sync/syncable/model_type.cc

Issue 3072022: Added constants, strings, protos for app sync. (Closed)
Patch Set: Created 10 years, 4 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
« no previous file with comments | « chrome/browser/sync/syncable/model_type.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4c40498bfd2aaff7e4da92218656b69044393994..a7b07c28d3d7aa645c77e4c906bf62c448cb0a62 100644
--- a/chrome/browser/sync/syncable/model_type.cc
+++ b/chrome/browser/sync/syncable/model_type.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/sync/syncable/model_type.h"
#include "chrome/browser/sync/engine/syncproto.h"
+#include "chrome/browser/sync/protocol/app_specifics.pb.h"
#include "chrome/browser/sync/protocol/autofill_specifics.pb.h"
#include "chrome/browser/sync/protocol/bookmark_specifics.pb.h"
#include "chrome/browser/sync/protocol/extension_specifics.pb.h"
@@ -44,6 +45,9 @@ void AddDefaultExtensionValue(syncable::ModelType datatype,
case NIGORI:
specifics->MutableExtension(sync_pb::nigori);
break;
+ case APPS:
+ specifics->MutableExtension(sync_pb::app);
+ break;
default:
NOTREACHED() << "No known extension for model type.";
}
@@ -105,6 +109,9 @@ ModelType GetModelTypeFromSpecifics(const sync_pb::EntitySpecifics& specifics) {
if (specifics.HasExtension(sync_pb::nigori))
return NIGORI;
+ if (specifics.HasExtension(sync_pb::app))
+ return APPS;
+
return UNSPECIFIED;
}
@@ -126,6 +133,8 @@ std::string ModelTypeToString(ModelType model_type) {
return "Extensions";
case NIGORI:
return "Encryption keys";
+ case APPS:
+ return "Apps";
default:
NOTREACHED() << "No known extension for model type.";
return "INVALID";
@@ -143,6 +152,7 @@ const char kThemeNotificationType[] = "THEME";
const char kTypedUrlNotificationType[] = "TYPED_URL";
const char kExtensionNotificationType[] = "EXTENSION";
const char kNigoriNotificationType[] = "NIGORI";
+const char kAppNotificationType[] = "APP";
} // namespace
bool RealModelTypeToNotificationType(ModelType model_type,
@@ -172,6 +182,9 @@ bool RealModelTypeToNotificationType(ModelType model_type,
case NIGORI:
*notification_type = kNigoriNotificationType;
return true;
+ case APPS:
+ *notification_type = kAppNotificationType;
+ return true;
default:
break;
}
@@ -205,6 +218,9 @@ bool NotificationTypeToRealModelType(const std::string& notification_type,
} else if (notification_type == kNigoriNotificationType) {
*model_type = NIGORI;
return true;
+ } else if (notification_type == kAppNotificationType) {
+ *model_type = APPS;
+ return true;
}
*model_type = UNSPECIFIED;
return false;
« no previous file with comments | « chrome/browser/sync/syncable/model_type.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698