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

Unified Diff: chrome/browser/extensions/app_sync_data.cc

Issue 229553003: Implement syncing of bookmark apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 6 years, 8 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/extensions/app_sync_data.h ('k') | chrome/browser/extensions/bookmark_app_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/app_sync_data.cc
diff --git a/chrome/browser/extensions/app_sync_data.cc b/chrome/browser/extensions/app_sync_data.cc
index ac0fb07d6df6c30efb56396df59ac3ea4a578845..5b1623e8c9b7bec0d797a7f8ef37fce7266ba4bb 100644
--- a/chrome/browser/extensions/app_sync_data.cc
+++ b/chrome/browser/extensions/app_sync_data.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/extensions/app_sync_data.h"
+#include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
#include "extensions/common/extension.h"
#include "sync/api/sync_data.h"
#include "sync/protocol/app_specifics.pb.h"
@@ -33,6 +34,10 @@ AppSyncData::AppSyncData(const Extension& extension,
app_launch_ordinal_(app_launch_ordinal),
page_ordinal_(page_ordinal),
launch_type_(launch_type) {
+ if (extension.from_bookmark()) {
+ bookmark_app_description_ = extension.description();
+ bookmark_app_url_ = AppLaunchInfo::GetLaunchWebURL(&extension).spec();
+ }
}
AppSyncData::~AppSyncData() {}
@@ -69,6 +74,12 @@ void AppSyncData::PopulateAppSpecifics(sync_pb::AppSpecifics* specifics) const {
specifics->set_launch_type(sync_launch_type);
}
+ if (!bookmark_app_url_.empty())
+ specifics->set_bookmark_app_url(bookmark_app_url_);
+
+ if (!bookmark_app_description_.empty())
+ specifics->set_bookmark_app_description(bookmark_app_description_);
+
extension_sync_data_.PopulateExtensionSpecifics(
specifics->mutable_extension());
}
@@ -83,6 +94,9 @@ void AppSyncData::PopulateFromAppSpecifics(
launch_type_ = specifics.has_launch_type()
? static_cast<extensions::LaunchType>(specifics.launch_type())
: LAUNCH_TYPE_INVALID;
+
+ bookmark_app_url_ = specifics.bookmark_app_url();
+ bookmark_app_description_ = specifics.bookmark_app_description();
}
void AppSyncData::PopulateFromSyncData(const syncer::SyncData& sync_data) {
« no previous file with comments | « chrome/browser/extensions/app_sync_data.h ('k') | chrome/browser/extensions/bookmark_app_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698