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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/extensions/extension_sync_data.h" | 9 #include "chrome/browser/extensions/extension_sync_data.h" |
10 #include "extensions/common/constants.h" | 10 #include "extensions/common/constants.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 } | 21 } |
22 | 22 |
23 namespace extensions { | 23 namespace extensions { |
24 | 24 |
25 class Extension; | 25 class Extension; |
26 class ExtensionSyncData; | 26 class ExtensionSyncData; |
27 | 27 |
28 // A class that encapsulates the synced properties of an Application. | 28 // A class that encapsulates the synced properties of an Application. |
29 class AppSyncData { | 29 class AppSyncData { |
30 public: | 30 public: |
| 31 struct LinkedAppIconInfo { |
| 32 LinkedAppIconInfo(); |
| 33 ~LinkedAppIconInfo(); |
| 34 |
| 35 GURL url; |
| 36 int size; |
| 37 }; |
| 38 |
31 AppSyncData(); | 39 AppSyncData(); |
32 AppSyncData(const Extension& extension, | 40 AppSyncData(const Extension& extension, |
33 bool enabled, | 41 bool enabled, |
34 bool incognito_enabled, | 42 bool incognito_enabled, |
35 bool remote_install, | 43 bool remote_install, |
36 ExtensionSyncData::OptionalBoolean all_urls_enabled, | 44 ExtensionSyncData::OptionalBoolean all_urls_enabled, |
37 const syncer::StringOrdinal& app_launch_ordinal, | 45 const syncer::StringOrdinal& app_launch_ordinal, |
38 const syncer::StringOrdinal& page_ordinal, | 46 const syncer::StringOrdinal& page_ordinal, |
39 extensions::LaunchType launch_type); | 47 extensions::LaunchType launch_type); |
40 ~AppSyncData(); | 48 ~AppSyncData(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 } | 83 } |
76 | 84 |
77 const std::string& bookmark_app_description() const { | 85 const std::string& bookmark_app_description() const { |
78 return bookmark_app_description_; | 86 return bookmark_app_description_; |
79 } | 87 } |
80 | 88 |
81 const std::string& bookmark_app_icon_color() const { | 89 const std::string& bookmark_app_icon_color() const { |
82 return bookmark_app_icon_color_; | 90 return bookmark_app_icon_color_; |
83 } | 91 } |
84 | 92 |
| 93 const std::vector<LinkedAppIconInfo>& linked_icons() const { |
| 94 return linked_icons_; |
| 95 } |
| 96 |
85 private: | 97 private: |
86 // Convert an AppSyncData back out to a sync structure. | 98 // Convert an AppSyncData back out to a sync structure. |
87 void PopulateAppSpecifics(sync_pb::AppSpecifics* specifics) const; | 99 void PopulateAppSpecifics(sync_pb::AppSpecifics* specifics) const; |
88 | 100 |
89 // Populate this class from sync inputs. Return true if the input | 101 // Populate this class from sync inputs. Return true if the input |
90 // was valid. | 102 // was valid. |
91 bool PopulateFromAppSpecifics(const sync_pb::AppSpecifics& specifics); | 103 bool PopulateFromAppSpecifics(const sync_pb::AppSpecifics& specifics); |
92 bool PopulateFromSyncData(const syncer::SyncData& sync_data); | 104 bool PopulateFromSyncData(const syncer::SyncData& sync_data); |
93 | 105 |
94 ExtensionSyncData extension_sync_data_; | 106 ExtensionSyncData extension_sync_data_; |
95 syncer::StringOrdinal app_launch_ordinal_; | 107 syncer::StringOrdinal app_launch_ordinal_; |
96 syncer::StringOrdinal page_ordinal_; | 108 syncer::StringOrdinal page_ordinal_; |
97 extensions::LaunchType launch_type_; | 109 extensions::LaunchType launch_type_; |
98 std::string bookmark_app_url_; | 110 std::string bookmark_app_url_; |
99 std::string bookmark_app_description_; | 111 std::string bookmark_app_description_; |
100 std::string bookmark_app_icon_color_; | 112 std::string bookmark_app_icon_color_; |
| 113 std::vector<LinkedAppIconInfo> linked_icons_; |
101 }; | 114 }; |
102 | 115 |
103 } // namespace extensions | 116 } // namespace extensions |
104 | 117 |
105 #endif // CHROME_BROWSER_EXTENSIONS_APP_SYNC_DATA_H_ | 118 #endif // CHROME_BROWSER_EXTENSIONS_APP_SYNC_DATA_H_ |
OLD | NEW |