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( \ |