[desktop-pwas] Show and sync theme color for bookmark apps on CrOS.
This CL makes bookmark apps display their title bar in the theme color
specified by the manifest. It also syncs this field across devices with
all other bookmark app information.
This adds a theme_color key to the extension manifest and app sync
specifics which represents the theme color in the extension and sync
systems respectively.
Bug: 762401
Change-Id: If13d58558122ea89efa75dba392b187956c0ff69
Reviewed-on: https://chromium-review.googlesource.com/680677
Reviewed-by: Peter Kotwicz <[email protected]>
Reviewed-by: Trent Apted <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Reviewed-by: Devlin <[email protected]>
Reviewed-by: Nicolas Zea <[email protected]>
Commit-Queue: calamity <[email protected]>
Cr-Commit-Position: refs/heads/master@{#508970}
diff --git a/chrome/browser/extensions/extension_sync_data.cc b/chrome/browser/extensions/extension_sync_data.cc
index e208d09b..1d16eada 100644
--- a/chrome/browser/extensions/extension_sync_data.cc
+++ b/chrome/browser/extensions/extension_sync_data.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/common/extensions/manifest_handlers/app_icon_color_info.h"
#include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
+#include "chrome/common/extensions/manifest_handlers/app_theme_color_info.h"
#include "chrome/common/extensions/manifest_handlers/linked_app_icons.h"
#include "components/crx_file/id_util.h"
#include "components/sync/model/sync_data.h"
@@ -127,6 +128,7 @@
bookmark_app_url_ = AppLaunchInfo::GetLaunchWebURL(&extension).spec();
bookmark_app_scope_ = GetScopeURLFromBookmarkApp(&extension).spec();
bookmark_app_icon_color_ = AppIconColorInfo::GetIconColorString(&extension);
+ bookmark_app_theme_color_ = AppThemeColorInfo::GetThemeColor(&extension);
extensions::LinkedAppIcons icons =
LinkedAppIcons::GetLinkedAppIcons(&extension);
for (const auto& icon : icons.icons) {
@@ -226,6 +228,9 @@
if (!bookmark_app_icon_color_.empty())
specifics->set_bookmark_app_icon_color(bookmark_app_icon_color_);
+ if (bookmark_app_theme_color_)
+ specifics->set_bookmark_app_theme_color(bookmark_app_theme_color_.value());
+
for (const auto& linked_icon : linked_icons_) {
sync_pb::LinkedAppIconInfo* linked_app_icon_info =
specifics->add_linked_app_icons();
@@ -299,8 +304,10 @@
bookmark_app_url_ = specifics.bookmark_app_url();
bookmark_app_description_ = specifics.bookmark_app_description();
- bookmark_app_scope_ = specifics.bookmark_app_url();
+ bookmark_app_scope_ = specifics.bookmark_app_scope();
bookmark_app_icon_color_ = specifics.bookmark_app_icon_color();
+ if (specifics.has_bookmark_app_theme_color())
+ bookmark_app_theme_color_ = specifics.bookmark_app_theme_color();
for (int i = 0; i < specifics.linked_app_icons_size(); ++i) {
const sync_pb::LinkedAppIconInfo& linked_app_icon_info =