Chromium Code Reviews| 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 f3a817d4bb694894842e166d1d22996a6e203ef5..f1f4b4eaa3534ed3b61c1cac760750d2ac63023c 100644 |
| --- a/chrome/browser/extensions/app_sync_data.cc |
| +++ b/chrome/browser/extensions/app_sync_data.cc |
| @@ -27,10 +27,12 @@ AppSyncData::AppSyncData(const Extension& extension, |
| bool enabled, |
| bool incognito_enabled, |
| const syncer::StringOrdinal& app_launch_ordinal, |
| - const syncer::StringOrdinal& page_ordinal) |
| + const syncer::StringOrdinal& page_ordinal, |
| + extensions::LaunchType launch_type) |
| : extension_sync_data_(extension, enabled, incognito_enabled), |
| app_launch_ordinal_(app_launch_ordinal), |
| - page_ordinal_(page_ordinal) { |
| + page_ordinal_(page_ordinal), |
| + launch_type_(launch_type) { |
| } |
| AppSyncData::~AppSyncData() {} |
| @@ -51,12 +53,17 @@ syncer::SyncChange AppSyncData::GetSyncChange( |
| void AppSyncData::PopulateAppSpecifics(sync_pb::AppSpecifics* specifics) const { |
| DCHECK(specifics); |
| - // Only sync the ordinal values if they are valid. |
| + // Only sync the ordinal values and launch type if they are valid. |
| if (app_launch_ordinal_.IsValid()) |
| specifics->set_app_launch_ordinal(app_launch_ordinal_.ToInternalValue()); |
| if (page_ordinal_.IsValid()) |
| specifics->set_page_ordinal(page_ordinal_.ToInternalValue()); |
| + if (launch_type_ >= extensions::LAUNCH_TYPE_FIRST && |
| + launch_type_ < extensions::NUM_LAUNCH_TYPES) { |
| + specifics->set_launch_type(launch_type_); |
| + } |
| + |
| extension_sync_data_.PopulateExtensionSpecifics( |
| specifics->mutable_extension()); |
| } |
| @@ -67,6 +74,10 @@ void AppSyncData::PopulateFromAppSpecifics( |
| app_launch_ordinal_ = syncer::StringOrdinal(specifics.app_launch_ordinal()); |
| page_ordinal_ = syncer::StringOrdinal(specifics.page_ordinal()); |
| + |
| + launch_type_ = specifics.has_launch_type() |
|
Nicolas Zea
2013/12/18 21:14:04
It might be worth considering what might happen if
calamity
2013/12/19 06:27:52
Hmm yeah. We also wouldn't want to write an invali
Nicolas Zea
2013/12/19 19:57:00
See my other comment. If we're introducing a misma
|
| + ? static_cast<extensions::LaunchType>(specifics.launch_type()) |
| + : LAUNCH_TYPE_INVALID; |
| } |
| void AppSyncData::PopulateFromSyncData(const syncer::SyncData& sync_data) { |