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

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

Issue 7150023: Add protobuffer and model type for syncing custom search engines. Includes all boilerplate helper... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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/nigori_util.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
===================================================================
--- chrome/browser/sync/syncable/model_type.cc (revision 89422)
+++ chrome/browser/sync/syncable/model_type.cc (working copy)
@@ -14,6 +14,7 @@
#include "chrome/browser/sync/protocol/nigori_specifics.pb.h"
#include "chrome/browser/sync/protocol/password_specifics.pb.h"
#include "chrome/browser/sync/protocol/preference_specifics.pb.h"
+#include "chrome/browser/sync/protocol/search_engine_specifics.pb.h"
#include "chrome/browser/sync/protocol/session_specifics.pb.h"
#include "chrome/browser/sync/protocol/sync.pb.h"
#include "chrome/browser/sync/protocol/theme_specifics.pb.h"
@@ -51,6 +52,9 @@
case NIGORI:
specifics->MutableExtension(sync_pb::nigori);
break;
+ case SEARCH_ENGINES:
+ specifics->MutableExtension(sync_pb::search_engine);
+ break;
case SESSIONS:
specifics->MutableExtension(sync_pb::session);
break;
@@ -101,6 +105,9 @@
case NIGORI:
return sync_pb::kNigoriFieldNumber;
break;
+ case SEARCH_ENGINES:
+ return sync_pb::kSearchEngineFieldNumber;
+ break;
case SESSIONS:
return sync_pb::kSessionFieldNumber;
break;
@@ -178,6 +185,9 @@
if (specifics.HasExtension(sync_pb::app))
return APPS;
+ if (specifics.HasExtension(sync_pb::search_engine))
+ return SEARCH_ENGINES;
+
if (specifics.HasExtension(sync_pb::session))
return SESSIONS;
@@ -202,6 +212,8 @@
return "Extensions";
case NIGORI:
return "Encryption keys";
+ case SEARCH_ENGINES:
+ return "Search Engines";
case SESSIONS:
return "Sessions";
case APPS:
@@ -257,6 +269,8 @@
return EXTENSIONS;
else if (model_type_string == "Encryption keys")
return NIGORI;
+ else if (model_type_string == "Search Engines")
+ return SEARCH_ENGINES;
else if (model_type_string == "Sessions")
return SESSIONS;
else if (model_type_string == "Apps")
@@ -341,6 +355,8 @@
return "google_chrome_extensions";
case NIGORI:
return "google_chrome_nigori";
+ case SEARCH_ENGINES:
+ return "google_chrome_search_engines";
case SESSIONS:
return "google_chrome_sessions";
case APPS:
@@ -398,6 +414,10 @@
SYNC_FREQ_HISTOGRAM("Sync.FreqNigori", time);
return;
}
+ case SEARCH_ENGINES: {
+ SYNC_FREQ_HISTOGRAM("Sync.FreqSearchEngines", time);
+ return;
+ }
case SESSIONS: {
SYNC_FREQ_HISTOGRAM("Sync.FreqSessions", time);
return;
@@ -425,6 +445,7 @@
const char kExtensionNotificationType[] = "EXTENSION";
const char kNigoriNotificationType[] = "NIGORI";
const char kAppNotificationType[] = "APP";
+const char kSearchEngineNotificationType[] = "SEARCH_ENGINE";
const char kSessionNotificationType[] = "SESSION";
const char kAutofillProfileNotificationType[] = "AUTOFILL_PROFILE";
} // namespace
@@ -459,6 +480,9 @@
case APPS:
*notification_type = kAppNotificationType;
return true;
+ case SEARCH_ENGINES:
+ *notification_type = kSearchEngineNotificationType;
+ return true;
case SESSIONS:
*notification_type = kSessionNotificationType;
return true;
@@ -501,6 +525,9 @@
} else if (notification_type == kAppNotificationType) {
*model_type = APPS;
return true;
+ } else if (notification_type == kSearchEngineNotificationType) {
+ *model_type = SEARCH_ENGINES;
+ return true;
} else if (notification_type == kSessionNotificationType) {
*model_type = SESSIONS;
return true;
« no previous file with comments | « chrome/browser/sync/syncable/model_type.h ('k') | chrome/browser/sync/syncable/nigori_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698