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

Unified Diff: chrome/browser/sync/engine/syncapi.cc

Issue 3072022: Added constants, strings, protos for app sync. (Closed)
Patch Set: Created 10 years, 4 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/engine/syncapi.h ('k') | chrome/browser/sync/protocol/app_specifics.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/syncapi.cc
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc
index a895e73695e49b0726ea08a8ae588870facf4a7b..8796243ad60fc96a688b0dc58eff84d660902e21 100644
--- a/chrome/browser/sync/engine/syncapi.cc
+++ b/chrome/browser/sync/engine/syncapi.cc
@@ -34,6 +34,7 @@
#include "chrome/browser/sync/engine/syncer.h"
#include "chrome/browser/sync/engine/syncer_thread.h"
#include "chrome/browser/sync/notifier/server_notifier_thread.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"
#include "chrome/browser/sync/protocol/extension_specifics.pb.h"
@@ -253,6 +254,11 @@ int64 BaseNode::GetExternalId() const {
return GetEntry()->Get(syncable::LOCAL_EXTERNAL_ID);
}
+const sync_pb::AppSpecifics& BaseNode::GetAppSpecifics() const {
+ DCHECK(GetModelType() == syncable::APPS);
+ return GetEntry()->Get(SPECIFICS).GetExtension(sync_pb::app);
+}
+
const sync_pb::AutofillSpecifics& BaseNode::GetAutofillSpecifics() const {
DCHECK(GetModelType() == syncable::AUTOFILL);
return GetEntry()->Get(SPECIFICS).GetExtension(sync_pb::autofill);
@@ -327,6 +333,12 @@ void WriteNode::SetURL(const GURL& url) {
SetBookmarkSpecifics(new_value);
}
+void WriteNode::SetAppSpecifics(
+ const sync_pb::AppSpecifics& new_value) {
+ DCHECK(GetModelType() == syncable::APPS);
+ PutAppSpecificsAndMarkForSyncing(new_value);
+}
+
void WriteNode::SetAutofillSpecifics(
const sync_pb::AutofillSpecifics& new_value) {
DCHECK(GetModelType() == syncable::AUTOFILL);
@@ -418,6 +430,13 @@ void WriteNode::SetExtensionSpecifics(
PutExtensionSpecificsAndMarkForSyncing(new_value);
}
+void WriteNode::PutAppSpecificsAndMarkForSyncing(
+ const sync_pb::AppSpecifics& new_value) {
+ sync_pb::EntitySpecifics entity_specifics;
+ entity_specifics.MutableExtension(sync_pb::app)->CopyFrom(new_value);
+ PutSpecificsAndMarkForSyncing(entity_specifics);
+}
+
void WriteNode::PutThemeSpecificsAndMarkForSyncing(
const sync_pb::ThemeSpecifics& new_value) {
sync_pb::EntitySpecifics entity_specifics;
« no previous file with comments | « chrome/browser/sync/engine/syncapi.h ('k') | chrome/browser/sync/protocol/app_specifics.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698