| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/app_sync_data.h" | 5 #include "chrome/browser/extensions/app_sync_data.h" |
| 6 | 6 |
| 7 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" | 7 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
| 8 #include "extensions/common/extension.h" | 8 #include "extensions/common/extension.h" |
| 9 #include "sync/api/sync_data.h" | 9 #include "sync/api/sync_data.h" |
| 10 #include "sync/protocol/app_specifics.pb.h" | 10 #include "sync/protocol/app_specifics.pb.h" |
| 11 #include "sync/protocol/sync.pb.h" | 11 #include "sync/protocol/sync.pb.h" |
| 12 | 12 |
| 13 namespace extensions { | 13 namespace extensions { |
| 14 | 14 |
| 15 AppSyncData::AppSyncData() {} | 15 AppSyncData::AppSyncData() {} |
| 16 | 16 |
| 17 AppSyncData::AppSyncData(const syncer::SyncData& sync_data) { | 17 AppSyncData::AppSyncData(const syncer::SyncData& sync_data) { |
| 18 PopulateFromSyncData(sync_data); | 18 PopulateFromSyncData(sync_data); |
| 19 } | 19 } |
| 20 | 20 |
| 21 AppSyncData::AppSyncData(const syncer::SyncChange& sync_change) { | 21 AppSyncData::AppSyncData(const syncer::SyncChange& sync_change) { |
| 22 PopulateFromSyncData(sync_change.sync_data()); | 22 PopulateFromSyncData(sync_change.sync_data()); |
| 23 extension_sync_data_.set_uninstalled( | 23 extension_sync_data_.set_uninstalled( |
| 24 sync_change.change_type() == syncer::SyncChange::ACTION_DELETE); | 24 sync_change.change_type() == syncer::SyncChange::ACTION_DELETE); |
| 25 } | 25 } |
| 26 | 26 |
| 27 AppSyncData::AppSyncData(const Extension& extension, | 27 AppSyncData::AppSyncData(const Extension& extension, |
| 28 bool enabled, | 28 bool enabled, |
| 29 bool incognito_enabled, | 29 bool incognito_enabled, |
| 30 bool remote_install, |
| 30 const syncer::StringOrdinal& app_launch_ordinal, | 31 const syncer::StringOrdinal& app_launch_ordinal, |
| 31 const syncer::StringOrdinal& page_ordinal, | 32 const syncer::StringOrdinal& page_ordinal, |
| 32 extensions::LaunchType launch_type) | 33 extensions::LaunchType launch_type) |
| 33 : extension_sync_data_(extension, enabled, incognito_enabled), | 34 : extension_sync_data_(extension, |
| 35 enabled, |
| 36 incognito_enabled, |
| 37 remote_install), |
| 34 app_launch_ordinal_(app_launch_ordinal), | 38 app_launch_ordinal_(app_launch_ordinal), |
| 35 page_ordinal_(page_ordinal), | 39 page_ordinal_(page_ordinal), |
| 36 launch_type_(launch_type) { | 40 launch_type_(launch_type) { |
| 37 if (extension.from_bookmark()) { | 41 if (extension.from_bookmark()) { |
| 38 bookmark_app_description_ = extension.description(); | 42 bookmark_app_description_ = extension.description(); |
| 39 bookmark_app_url_ = AppLaunchInfo::GetLaunchWebURL(&extension).spec(); | 43 bookmark_app_url_ = AppLaunchInfo::GetLaunchWebURL(&extension).spec(); |
| 40 } | 44 } |
| 41 } | 45 } |
| 42 | 46 |
| 43 AppSyncData::~AppSyncData() {} | 47 AppSyncData::~AppSyncData() {} |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 101 |
| 98 bookmark_app_url_ = specifics.bookmark_app_url(); | 102 bookmark_app_url_ = specifics.bookmark_app_url(); |
| 99 bookmark_app_description_ = specifics.bookmark_app_description(); | 103 bookmark_app_description_ = specifics.bookmark_app_description(); |
| 100 } | 104 } |
| 101 | 105 |
| 102 void AppSyncData::PopulateFromSyncData(const syncer::SyncData& sync_data) { | 106 void AppSyncData::PopulateFromSyncData(const syncer::SyncData& sync_data) { |
| 103 PopulateFromAppSpecifics(sync_data.GetSpecifics().app()); | 107 PopulateFromAppSpecifics(sync_data.GetSpecifics().app()); |
| 104 } | 108 } |
| 105 | 109 |
| 106 } // namespace extensions | 110 } // namespace extensions |
| OLD | NEW |