Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3714)

Unified Diff: chrome/browser/extensions/extension_sync_service.cc

Issue 782693002: Ensure there are always nice icons for bookmark apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac compile Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_sync_service.cc
diff --git a/chrome/browser/extensions/extension_sync_service.cc b/chrome/browser/extensions/extension_sync_service.cc
index 895da0236f2d940e0a45e5ac8da915a81f9e6ada..cd8d3aa9d1e55d30e024374f34495edaab2c56f0 100644
--- a/chrome/browser/extensions/extension_sync_service.cc
+++ b/chrome/browser/extensions/extension_sync_service.cc
@@ -32,6 +32,7 @@
#include "extensions/common/extension.h"
#include "extensions/common/extension_icon_set.h"
#include "extensions/common/feature_switch.h"
+#include "extensions/common/image_util.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_handlers/icons_handler.h"
#include "sync/api/sync_change.h"
@@ -56,7 +57,7 @@ void OnWebApplicationInfoLoaded(
// Use the old icons if they exist.
synced_info.icons = loaded_info.icons;
- CreateOrUpdateBookmarkApp(extension_service.get(), synced_info);
+ CreateOrUpdateBookmarkApp(extension_service.get(), &synced_info);
}
} // namespace
@@ -388,10 +389,15 @@ void ExtensionSyncService::ProcessBookmarkAppSyncData(
base::UTF8ToUTF16(app_sync_data.extension_sync_data().name());
web_app_info.description =
base::UTF8ToUTF16(app_sync_data.bookmark_app_description());
+ if (!app_sync_data.bookmark_app_icon_color().empty()) {
+ extensions::image_util::ParseCSSColorString(
+ app_sync_data.bookmark_app_icon_color(),
+ &web_app_info.generated_icon_color);
+ }
// If the bookmark app already exists, keep the old icons.
if (!extension) {
- CreateOrUpdateBookmarkApp(extension_service_, web_app_info);
+ CreateOrUpdateBookmarkApp(extension_service_, &web_app_info);
} else {
app_sync_data.extension_sync_data().name();
GetWebApplicationInfoFromApp(profile_,
« no previous file with comments | « chrome/browser/extensions/convert_web_app.cc ('k') | chrome/browser/sync/test/integration/two_client_apps_sync_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698