| 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SYNC_DATA_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SYNC_DATA_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYNC_DATA_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYNC_DATA_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/version.h" | 11 #include "base/version.h" |
| 12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 13 | 13 |
| 14 // A struct that encapsulates the synced properties of an Extension. | 14 // A struct that encapsulates the synced properties of an Extension. |
| 15 struct ExtensionSyncData { | 15 struct ExtensionSyncData { |
| 16 ExtensionSyncData(); | 16 ExtensionSyncData(); |
| 17 ~ExtensionSyncData(); | 17 ~ExtensionSyncData(); |
| 18 | 18 |
| 19 // Merge |new_data| into this object. All version-independent |
| 20 // properties are copied from |new_data|, and version-dependent |
| 21 // properties are copied only if |new_data|'s version is equal to or |
| 22 // greater than the current version. |
| 23 void Merge(const ExtensionSyncData& new_data); |
| 24 |
| 19 std::string id; | 25 std::string id; |
| 20 | 26 |
| 21 // Version-independent properties (i.e., used even when the | 27 // Version-independent properties (i.e., used even when the |
| 22 // version of the currently-installed extension doesn't match | 28 // version of the currently-installed extension doesn't match |
| 23 // |version|). | 29 // |version|). |
| 24 bool uninstalled; | 30 bool uninstalled; |
| 25 bool enabled; | 31 bool enabled; |
| 26 bool incognito_enabled; | 32 bool incognito_enabled; |
| 27 | 33 |
| 28 // Version-dependent properties (i.e., should be used only when the | 34 // Version-dependent properties (i.e., should be used only when the |
| 29 // version of the currenty-installed extension matches |version|). | 35 // version of the currenty-installed extension matches |version|). |
| 30 Version version; | 36 Version version; |
| 31 GURL update_url; | 37 GURL update_url; |
| 32 | |
| 33 // Used only for debugging. | 38 // Used only for debugging. |
| 34 std::string name; | 39 std::string name; |
| 35 }; | 40 }; |
| 36 | 41 |
| 37 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYNC_DATA_H_ | 42 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYNC_DATA_H_ |
| OLD | NEW |