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

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

Issue 6465005: [Sync] Initial support for encrypting any datatype (no UI hookup yet). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + small fix Created 9 years, 10 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/browser/sync/syncable/model_type_unittest.cc » ('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 0ff67bdb8d5f4463a2741b5daaeb3ab603fd9aa9..b9e42e20ddc0927c051703569547cd9d9e6e69e6 100644
--- a/chrome/browser/sync/syncable/model_type.cc
+++ b/chrome/browser/sync/syncable/model_type.cc
@@ -261,13 +261,54 @@ ListValue* ModelTypeBitSetToValue(const ModelTypeBitSet& model_types) {
for (int i = FIRST_REAL_MODEL_TYPE; i < MODEL_TYPE_COUNT; ++i) {
if (model_types[i]) {
value->Append(
- Value::CreateStringValue(
- ModelTypeToString(ModelTypeFromInt(i))));
+ Value::CreateStringValue(ModelTypeToString(ModelTypeFromInt(i))));
}
}
return value;
}
+ListValue* ModelTypeSetToValue(const ModelTypeSet& model_types) {
+ ListValue* value = new ListValue();
+ for (ModelTypeSet::const_iterator i = model_types.begin();
+ i != model_types.end(); ++i) {
+ value->Append(Value::CreateStringValue(ModelTypeToString(*i)));
+ }
+ return value;
+}
+
+// TODO(zea): remove all hardcoded tags in model associators and have them use
+// this instead.
+std::string ModelTypeToRootTag(ModelType type) {
+ switch (type) {
+ case BOOKMARKS:
+ return "google_chrome_bookmarks";
+ case PREFERENCES:
+ return "google_chrome_preferences";
+ case PASSWORDS:
+ return "google_chrome_passwords";
+ case AUTOFILL:
+ return "google_chrome_autofill";
+ case THEMES:
+ return "google_chrome_themes";
+ case TYPED_URLS:
+ return "google_chrome_typed_urls";
+ case EXTENSIONS:
+ return "google_chrome_extensions";
+ case NIGORI:
+ return "google_chrome_nigori";
+ case SESSIONS:
+ return "google_chrome_sessions";
+ case APPS:
+ return "google_chrome_apps";
+ case AUTOFILL_PROFILE:
+ return "google_chrome_autofill_profiles";
+ default:
+ break;
+ }
+ NOTREACHED() << "No known extension for model type.";
+ return "INVALID";
+}
+
// For now, this just implements UMA_HISTOGRAM_LONG_TIMES. This can be adjusted
// if we feel the min, max, or bucket count amount are not appropriate.
#define SYNC_FREQ_HISTOGRAM(name, time) UMA_HISTOGRAM_CUSTOM_TIMES( \
« no previous file with comments | « chrome/browser/sync/syncable/model_type.h ('k') | chrome/browser/sync/syncable/model_type_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698