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

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

Issue 4096004: PyAuto hooks for Sync in TestingAutomationProvider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase; Addressing final review comment. Created 10 years, 1 month 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/test/functional/PYAUTO_TESTS » ('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 5a06be84d43d53fd87f7a1e33b421bb636c1f3f5..2d17ebc8248908c028178dc437c109f5dd8a66bf 100644
--- a/chrome/browser/sync/syncable/model_type.cc
+++ b/chrome/browser/sync/syncable/model_type.cc
@@ -150,6 +150,33 @@ std::string ModelTypeToString(ModelType model_type) {
}
}
+ModelType ModelTypeFromString(const std::string& model_type_string) {
+ if (model_type_string == "Bookmarks")
+ return BOOKMARKS;
+ else if (model_type_string == "Preferences")
+ return PREFERENCES;
+ else if (model_type_string == "Passwords")
+ return PASSWORDS;
+ else if (model_type_string == "Autofill")
+ return AUTOFILL;
+ else if (model_type_string == "Themes")
+ return THEMES;
+ else if (model_type_string == "Typed URLs")
+ return TYPED_URLS;
+ else if (model_type_string == "Extensions")
+ return EXTENSIONS;
+ else if (model_type_string == "Encryption keys")
+ return NIGORI;
+ else if (model_type_string == "Sessions")
+ return SESSIONS;
+ else if (model_type_string == "Apps")
+ return APPS;
+ else
+ NOTREACHED() << "No known model type corresponding to "
+ << model_type_string << ".";
+ return UNSPECIFIED;
+}
+
// TODO(akalin): Figure out a better way to do these mappings.
namespace {
@@ -247,8 +274,7 @@ bool NotificationTypeToRealModelType(const std::string& notification_type,
} else if (notification_type == kSessionNotificationType) {
*model_type = SESSIONS;
return true;
- }
- else if (notification_type == kUnknownNotificationType) {
+ } 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.
« no previous file with comments | « chrome/browser/sync/syncable/model_type.h ('k') | chrome/test/functional/PYAUTO_TESTS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698