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

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

Issue 8375047: Separate the syncing of extension settings and app settings into separate data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 2 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/util/cryptographer.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 77c33aa464511e0fbb22a9e9ec6e16400b10cc08..aaf555eff12fed9d792ba4d1e0c08a039f7043f5 100644
--- a/chrome/browser/sync/syncable/model_type.cc
+++ b/chrome/browser/sync/syncable/model_type.cc
@@ -9,6 +9,7 @@
#include "base/values.h"
#include "chrome/browser/sync/engine/syncproto.h"
#include "chrome/browser/sync/protocol/app_notification_specifics.pb.h"
+#include "chrome/browser/sync/protocol/app_setting_specifics.pb.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"
@@ -64,6 +65,9 @@ void AddDefaultExtensionValue(syncable::ModelType datatype,
case APPS:
specifics->MutableExtension(sync_pb::app);
break;
+ case APP_SETTINGS:
+ specifics->MutableExtension(sync_pb::app_setting);
+ break;
case EXTENSION_SETTINGS:
specifics->MutableExtension(sync_pb::extension_setting);
break;
@@ -123,6 +127,9 @@ int GetExtensionFieldNumberFromModelType(ModelType model_type) {
case APPS:
return sync_pb::kAppFieldNumber;
break;
+ case APP_SETTINGS:
+ return sync_pb::kAppSettingFieldNumber;
+ break;
case EXTENSION_SETTINGS:
return sync_pb::kExtensionSettingFieldNumber;
break;
@@ -206,6 +213,9 @@ ModelType GetModelTypeFromSpecifics(const sync_pb::EntitySpecifics& specifics) {
if (specifics.HasExtension(sync_pb::session))
return SESSIONS;
+ if (specifics.HasExtension(sync_pb::app_setting))
+ return APP_SETTINGS;
+
if (specifics.HasExtension(sync_pb::extension_setting))
return EXTENSION_SETTINGS;
@@ -252,6 +262,8 @@ std::string ModelTypeToString(ModelType model_type) {
return "Apps";
case AUTOFILL_PROFILE:
return "Autofill Profiles";
+ case APP_SETTINGS:
+ return "App settings";
case EXTENSION_SETTINGS:
return "Extension settings";
case APP_NOTIFICATIONS:
@@ -326,6 +338,8 @@ ModelType ModelTypeFromString(const std::string& model_type_string) {
return SESSIONS;
else if (model_type_string == "Apps")
return APPS;
+ else if (model_type_string == "App settings")
+ return APP_SETTINGS;
else if (model_type_string == "Extension settings")
return EXTENSION_SETTINGS;
else if (model_type_string == "App Notifications")
@@ -422,6 +436,8 @@ std::string ModelTypeToRootTag(ModelType type) {
return "google_chrome_apps";
case AUTOFILL_PROFILE:
return "google_chrome_autofill_profiles";
+ case APP_SETTINGS:
+ return "google_chrome_app_settings";
case EXTENSION_SETTINGS:
return "google_chrome_extension_settings";
case APP_NOTIFICATIONS:
@@ -489,6 +505,10 @@ void PostTimeToTypeHistogram(ModelType model_type, base::TimeDelta time) {
SYNC_FREQ_HISTOGRAM("Sync.FreqApps", time);
return;
}
+ case APP_SETTINGS: {
+ SYNC_FREQ_HISTOGRAM("Sync.FreqAppSettings", time);
+ return;
+ }
case EXTENSION_SETTINGS: {
SYNC_FREQ_HISTOGRAM("Sync.FreqExtensionSettings", time);
return;
@@ -516,6 +536,7 @@ const char kTypedUrlNotificationType[] = "TYPED_URL";
const char kExtensionNotificationType[] = "EXTENSION";
const char kExtensionSettingNotificationType[] = "EXTENSION_SETTING";
const char kNigoriNotificationType[] = "NIGORI";
+const char kAppSettingNotificationType[] = "APP_SETTING";
const char kAppNotificationType[] = "APP";
const char kSearchEngineNotificationType[] = "SEARCH_ENGINE";
const char kSessionNotificationType[] = "SESSION";
@@ -550,6 +571,9 @@ bool RealModelTypeToNotificationType(ModelType model_type,
case NIGORI:
*notification_type = kNigoriNotificationType;
return true;
+ case APP_SETTINGS:
+ *notification_type = kAppNotificationType;
+ return true;
case APPS:
*notification_type = kAppNotificationType;
return true;
@@ -613,6 +637,8 @@ bool NotificationTypeToRealModelType(const std::string& notification_type,
} else if (notification_type == kAutofillProfileNotificationType) {
*model_type = AUTOFILL_PROFILE;
return true;
+ } else if (notification_type == kAppSettingNotificationType) {
+ *model_type = APP_SETTINGS;
Nico 2011/11/30 21:04:16 This branch is missing a "return true;" as far as
} else if (notification_type == kExtensionSettingNotificationType) {
*model_type = EXTENSION_SETTINGS;
return true;
« no previous file with comments | « chrome/browser/sync/syncable/model_type.h ('k') | chrome/browser/sync/util/cryptographer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698