| 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 #ifndef CHROME_BROWSER_EXTENSIONS_APP_SYNC_DATA_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_APP_SYNC_DATA_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_APP_SYNC_DATA_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_APP_SYNC_DATA_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/extensions/extension_sync_data.h" | 8 #include "chrome/browser/extensions/extension_sync_data.h" |
| 9 #include "chrome/common/extensions/extension_constants.h" | 9 #include "chrome/common/extensions/extension_constants.h" |
| 10 #include "sync/api/string_ordinal.h" | 10 #include "sync/api/string_ordinal.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 // A class that encapsulates the synced properties of an Application. | 26 // A class that encapsulates the synced properties of an Application. |
| 27 class AppSyncData { | 27 class AppSyncData { |
| 28 public: | 28 public: |
| 29 AppSyncData(); | 29 AppSyncData(); |
| 30 explicit AppSyncData(const syncer::SyncData& sync_data); | 30 explicit AppSyncData(const syncer::SyncData& sync_data); |
| 31 explicit AppSyncData(const syncer::SyncChange& sync_change); | 31 explicit AppSyncData(const syncer::SyncChange& sync_change); |
| 32 AppSyncData(const Extension& extension, | 32 AppSyncData(const Extension& extension, |
| 33 bool enabled, | 33 bool enabled, |
| 34 bool incognito_enabled, | 34 bool incognito_enabled, |
| 35 bool remote_install, |
| 35 const syncer::StringOrdinal& app_launch_ordinal, | 36 const syncer::StringOrdinal& app_launch_ordinal, |
| 36 const syncer::StringOrdinal& page_ordinal, | 37 const syncer::StringOrdinal& page_ordinal, |
| 37 extensions::LaunchType launch_type); | 38 extensions::LaunchType launch_type); |
| 38 ~AppSyncData(); | 39 ~AppSyncData(); |
| 39 | 40 |
| 40 // Retrive sync data from this class. | 41 // Retrive sync data from this class. |
| 41 syncer::SyncData GetSyncData() const; | 42 syncer::SyncData GetSyncData() const; |
| 42 syncer::SyncChange GetSyncChange( | 43 syncer::SyncChange GetSyncChange( |
| 43 syncer::SyncChange::SyncChangeType change_type) const; | 44 syncer::SyncChange::SyncChangeType change_type) const; |
| 44 | 45 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 56 const ExtensionSyncData& extension_sync_data() const { | 57 const ExtensionSyncData& extension_sync_data() const { |
| 57 return extension_sync_data_; | 58 return extension_sync_data_; |
| 58 } | 59 } |
| 59 | 60 |
| 60 extensions::LaunchType launch_type() const { | 61 extensions::LaunchType launch_type() const { |
| 61 return launch_type_; | 62 return launch_type_; |
| 62 } | 63 } |
| 63 | 64 |
| 64 const std::string& bookmark_app_url() const { | 65 const std::string& bookmark_app_url() const { |
| 65 return bookmark_app_url_; | 66 return bookmark_app_url_; |
| 66 }; | 67 } |
| 67 | 68 |
| 68 const std::string& bookmark_app_description() const { | 69 const std::string& bookmark_app_description() const { |
| 69 return bookmark_app_description_; | 70 return bookmark_app_description_; |
| 70 }; | 71 } |
| 71 | 72 |
| 72 private: | 73 private: |
| 73 // Convert an AppSyncData back out to a sync structure. | 74 // Convert an AppSyncData back out to a sync structure. |
| 74 void PopulateAppSpecifics(sync_pb::AppSpecifics* specifics) const; | 75 void PopulateAppSpecifics(sync_pb::AppSpecifics* specifics) const; |
| 75 | 76 |
| 76 // Populate this class from sync inputs. | 77 // Populate this class from sync inputs. |
| 77 void PopulateFromAppSpecifics( | 78 void PopulateFromAppSpecifics( |
| 78 const sync_pb::AppSpecifics& specifics); | 79 const sync_pb::AppSpecifics& specifics); |
| 79 void PopulateFromSyncData(const syncer::SyncData& sync_data); | 80 void PopulateFromSyncData(const syncer::SyncData& sync_data); |
| 80 | 81 |
| 81 ExtensionSyncData extension_sync_data_; | 82 ExtensionSyncData extension_sync_data_; |
| 82 syncer::StringOrdinal app_launch_ordinal_; | 83 syncer::StringOrdinal app_launch_ordinal_; |
| 83 syncer::StringOrdinal page_ordinal_; | 84 syncer::StringOrdinal page_ordinal_; |
| 84 extensions::LaunchType launch_type_; | 85 extensions::LaunchType launch_type_; |
| 85 std::string bookmark_app_url_; | 86 std::string bookmark_app_url_; |
| 86 std::string bookmark_app_description_; | 87 std::string bookmark_app_description_; |
| 87 }; | 88 }; |
| 88 | 89 |
| 89 } // namespace extensions | 90 } // namespace extensions |
| 90 | 91 |
| 91 #endif // CHROME_BROWSER_EXTENSIONS_APP_SYNC_DATA_H_ | 92 #endif // CHROME_BROWSER_EXTENSIONS_APP_SYNC_DATA_H_ |
| 92 | 93 |
| OLD | NEW |