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/browser/sync/api/sync_data.h" | 10 #include "chrome/browser/sync/api/sync_data.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 ExtensionSyncData::ExtensionSyncData(const Extension& extension, | 37 ExtensionSyncData::ExtensionSyncData(const Extension& extension, |
38 bool enabled, | 38 bool enabled, |
39 bool incognito_enabled) | 39 bool incognito_enabled) |
40 : id_(extension.id()), | 40 : id_(extension.id()), |
41 uninstalled_(false), | 41 uninstalled_(false), |
42 enabled_(enabled), | 42 enabled_(enabled), |
43 incognito_enabled_(incognito_enabled), | 43 incognito_enabled_(incognito_enabled), |
44 version_(*extension.version()), | 44 version_(*extension.version()), |
45 update_url_(extension.update_url()), | 45 update_url_(extension.update_url()), |
46 name_(extension.name()) { | 46 name_(extension.non_localized_name()) { |
47 } | 47 } |
48 | 48 |
49 ExtensionSyncData::~ExtensionSyncData() {} | 49 ExtensionSyncData::~ExtensionSyncData() {} |
50 | 50 |
51 SyncData ExtensionSyncData::GetSyncData() const { | 51 SyncData ExtensionSyncData::GetSyncData() const { |
52 sync_pb::EntitySpecifics specifics; | 52 sync_pb::EntitySpecifics specifics; |
53 PopulateExtensionSpecifics(specifics.mutable_extension()); | 53 PopulateExtensionSpecifics(specifics.mutable_extension()); |
54 | 54 |
55 return SyncData::CreateLocalData(id_, name_, specifics); | 55 return SyncData::CreateLocalData(id_, name_, specifics); |
56 } | 56 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 const sync_pb::EntitySpecifics& entity_specifics = sync_data.GetSpecifics(); | 103 const sync_pb::EntitySpecifics& entity_specifics = sync_data.GetSpecifics(); |
104 | 104 |
105 if (entity_specifics.has_extension()) { | 105 if (entity_specifics.has_extension()) { |
106 PopulateFromExtensionSpecifics(entity_specifics.extension()); | 106 PopulateFromExtensionSpecifics(entity_specifics.extension()); |
107 } else { | 107 } else { |
108 LOG(FATAL) << "Attempt to sync bad EntitySpecifics."; | 108 LOG(FATAL) << "Attempt to sync bad EntitySpecifics."; |
109 } | 109 } |
110 } | 110 } |
111 | 111 |
112 } // namespace extensions | 112 } // namespace extensions |
OLD | NEW |