| 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/extension_sync_data.h" | 5 #include "chrome/browser/extensions/extension_sync_data.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/extensions/app_sync_data.h" | 8 #include "chrome/browser/extensions/app_sync_data.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 update_url_(extension.update_url()), | 46 update_url_(extension.update_url()), |
| 47 name_(extension.non_localized_name()) { | 47 name_(extension.non_localized_name()) { |
| 48 } | 48 } |
| 49 | 49 |
| 50 ExtensionSyncData::~ExtensionSyncData() {} | 50 ExtensionSyncData::~ExtensionSyncData() {} |
| 51 | 51 |
| 52 syncer::SyncData ExtensionSyncData::GetSyncData() const { | 52 syncer::SyncData ExtensionSyncData::GetSyncData() const { |
| 53 sync_pb::EntitySpecifics specifics; | 53 sync_pb::EntitySpecifics specifics; |
| 54 PopulateExtensionSpecifics(specifics.mutable_extension()); | 54 PopulateExtensionSpecifics(specifics.mutable_extension()); |
| 55 | 55 |
| 56 return syncer::SyncData::CreateLocalData(id_, name_, specifics); | 56 return syncer::SyncData::CreateLocalData(id_, name_, specifics, false); |
| 57 } | 57 } |
| 58 | 58 |
| 59 syncer::SyncChange ExtensionSyncData::GetSyncChange( | 59 syncer::SyncChange ExtensionSyncData::GetSyncChange( |
| 60 syncer::SyncChange::SyncChangeType change_type) const { | 60 syncer::SyncChange::SyncChangeType change_type) const { |
| 61 return syncer::SyncChange(FROM_HERE, change_type, GetSyncData()); | 61 return syncer::SyncChange(FROM_HERE, change_type, GetSyncData()); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void ExtensionSyncData::PopulateExtensionSpecifics( | 64 void ExtensionSyncData::PopulateExtensionSpecifics( |
| 65 sync_pb::ExtensionSpecifics* specifics) const { | 65 sync_pb::ExtensionSpecifics* specifics) const { |
| 66 DCHECK(Extension::IdIsValid(id_)); | 66 DCHECK(Extension::IdIsValid(id_)); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 const sync_pb::EntitySpecifics& entity_specifics = sync_data.GetSpecifics(); | 105 const sync_pb::EntitySpecifics& entity_specifics = sync_data.GetSpecifics(); |
| 106 | 106 |
| 107 if (entity_specifics.has_extension()) { | 107 if (entity_specifics.has_extension()) { |
| 108 PopulateFromExtensionSpecifics(entity_specifics.extension()); | 108 PopulateFromExtensionSpecifics(entity_specifics.extension()); |
| 109 } else { | 109 } else { |
| 110 LOG(FATAL) << "Attempt to sync bad EntitySpecifics."; | 110 LOG(FATAL) << "Attempt to sync bad EntitySpecifics."; |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace extensions | 114 } // namespace extensions |
| OLD | NEW |