diff options
author | benwells <benwells@chromium.org> | 2015-04-28 19:39:19 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-29 02:40:08 +0000 |
commit | ed75d1b590e7ed38fa1a8f2f688925b390019aa6 (patch) | |
tree | 58d617be066312affe45702a8b72c46b072a2a00 /sync | |
parent | 35d9c4606318947a2711b760085f66d174a30b31 (diff) | |
download | chromium_src-ed75d1b590e7ed38fa1a8f2f688925b390019aa6.zip chromium_src-ed75d1b590e7ed38fa1a8f2f688925b390019aa6.tar.gz chromium_src-ed75d1b590e7ed38fa1a8f2f688925b390019aa6.tar.bz2 |
Sync bookmark app icon urls and sizes, and download icons for new apps.
This means bookmark apps can use proper icons from the web page or the
pages manifest, and have these reflectd on all devices the bookmark
app is synced to.
BUG=480049
Review URL: https://codereview.chromium.org/1066623008
Cr-Commit-Position: refs/heads/master@{#327424}
Diffstat (limited to 'sync')
-rw-r--r-- | sync/protocol/app_specifics.proto | 13 | ||||
-rw-r--r-- | sync/protocol/proto_value_conversions.cc | 10 | ||||
-rw-r--r-- | sync/protocol/proto_value_conversions.h | 6 | ||||
-rw-r--r-- | sync/protocol/proto_value_conversions_unittest.cc | 4 |
4 files changed, 32 insertions, 1 deletions
diff --git a/sync/protocol/app_specifics.proto b/sync/protocol/app_specifics.proto index a43ea2f..fe07d2d 100644 --- a/sync/protocol/app_specifics.proto +++ b/sync/protocol/app_specifics.proto @@ -38,6 +38,15 @@ message AppNotificationSettings { optional string oauth_client_id = 3; } +// Information about a linked app icon. +message LinkedAppIconInfo { + // The URL of the app icon. + optional string url = 1; + + // The size of the app icon in DIPs. + optional uint32 size = 2; +} + // Properties of app sync objects. // // For now, an app is just an extension. We keep the two data types @@ -79,4 +88,8 @@ message AppSpecifics { // This is the color to use when generating bookmark app icons. The string is // in #rrggbb or #rgb syntax, e.g. #d8d8d8. optional string bookmark_app_icon_color = 8; + + // This is information about linked icons (that is, icons that are downloaded + // from outside the app's bundle of files. + repeated LinkedAppIconInfo linked_app_icons = 9; } diff --git a/sync/protocol/proto_value_conversions.cc b/sync/protocol/proto_value_conversions.cc index de55704..f169f4f 100644 --- a/sync/protocol/proto_value_conversions.cc +++ b/sync/protocol/proto_value_conversions.cc @@ -298,6 +298,14 @@ base::DictionaryValue* AppSettingSpecificsToValue( return value; } +base::DictionaryValue* LinkedAppIconInfoToValue( + const sync_pb::LinkedAppIconInfo& proto) { + base::DictionaryValue* value = new base::DictionaryValue(); + SET_STR(url); + SET_INT32(size); + return value; +} + base::DictionaryValue* AppSpecificsToValue( const sync_pb::AppSpecifics& proto) { base::DictionaryValue* value = new base::DictionaryValue(); @@ -308,6 +316,8 @@ base::DictionaryValue* AppSpecificsToValue( SET_ENUM(launch_type, GetLaunchTypeString); SET_STR(bookmark_app_url); SET_STR(bookmark_app_description); + SET_STR(bookmark_app_icon_color); + SET_REP(linked_app_icons, LinkedAppIconInfoToValue); return value; } diff --git a/sync/protocol/proto_value_conversions.h b/sync/protocol/proto_value_conversions.h index 02d7314..8aa02ad 100644 --- a/sync/protocol/proto_value_conversions.h +++ b/sync/protocol/proto_value_conversions.h @@ -46,6 +46,7 @@ class FaviconTrackingSpecifics; class GlobalIdDirective; class HistoryDeleteDirectiveSpecifics; class KeystoreEncryptionFlagsSpecifics; +class LinkedAppIconInfo; class Media; class ManagedUserSettingSpecifics; class ManagedUserSharedSettingSpecifics; @@ -99,10 +100,13 @@ SYNC_EXPORT_PRIVATE base::DictionaryValue* EncryptedDataToValue( SYNC_EXPORT_PRIVATE base::DictionaryValue* AppListSpecificsToValue( const sync_pb::AppListSpecifics& proto); -// Sub-protocol of AppSpecifics. +// Sub-protocols of AppSpecifics. SYNC_EXPORT_PRIVATE base::DictionaryValue* AppSettingsToValue( const sync_pb::AppNotificationSettings& app_notification_settings); +SYNC_EXPORT_PRIVATE base::DictionaryValue* LinkedAppIconInfoToValue( + const sync_pb::LinkedAppIconInfo& linked_app_icon_info); + // Sub-protocols of SessionSpecifics. SYNC_EXPORT_PRIVATE base::DictionaryValue* SessionHeaderToValue( diff --git a/sync/protocol/proto_value_conversions_unittest.cc b/sync/protocol/proto_value_conversions_unittest.cc index d52223b..47eb940 100644 --- a/sync/protocol/proto_value_conversions_unittest.cc +++ b/sync/protocol/proto_value_conversions_unittest.cc @@ -182,6 +182,10 @@ TEST_F(ProtoValueConversionsTest, BookmarkSpecificsData) { EXPECT_EQ("value2", meta_value); } +TEST_F(ProtoValueConversionsTest, LinkedAppIconInfoToValue) { + TestSpecificsToValue(LinkedAppIconInfoToValue); +} + TEST_F(ProtoValueConversionsTest, PriorityPreferenceSpecificsToValue) { TestSpecificsToValue(PriorityPreferenceSpecificsToValue); } |