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

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: Comments. Rest of unit tests. 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
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 1aea654fbcc8bf2a191ec4075b7b0843da007bc0..97c4a3ddbc59e5d4dba39410cdf79db09fbb961e 100644
--- a/chrome/browser/sync/syncable/model_type.cc
+++ b/chrome/browser/sync/syncable/model_type.cc
@@ -255,6 +255,39 @@ bool ModelTypeBitSetFromString(
return iss.eof();
}
+// 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( \

Powered by Google App Engine
This is Rietveld 408576698