| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
| 8 |
| 7 ExtensionSyncData::ExtensionSyncData() | 9 ExtensionSyncData::ExtensionSyncData() |
| 8 : uninstalled(false), enabled(false), incognito_enabled(false) {} | 10 : uninstalled(false), enabled(false), incognito_enabled(false) {} |
| 9 | 11 |
| 10 ExtensionSyncData::~ExtensionSyncData() {} | 12 ExtensionSyncData::~ExtensionSyncData() {} |
| 13 |
| 14 void ExtensionSyncData::Merge(const ExtensionSyncData& new_data) { |
| 15 CHECK_EQ(id, new_data.id); |
| 16 CHECK(!uninstalled); |
| 17 CHECK(!new_data.uninstalled); |
| 18 |
| 19 // Copy version-independent properties. |
| 20 enabled = new_data.enabled; |
| 21 incognito_enabled = new_data.incognito_enabled; |
| 22 |
| 23 // Copy version-dependent properties if version <= new_data.version. |
| 24 if (version.CompareTo(new_data.version) <= 0) { |
| 25 version = new_data.version; |
| 26 update_url = new_data.update_url; |
| 27 name = new_data.name; |
| 28 } |
| 29 } |
| OLD | NEW |