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

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

Issue 1066623008: Sync bookmark app icon urls and sizes, and download icons for new apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix failing tests and extra checks Created 5 years, 8 months 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/convert_web_app.cc
diff --git a/chrome/browser/extensions/convert_web_app.cc b/chrome/browser/extensions/convert_web_app.cc
index 04becdc5bc131a6311d3419d11a14cfb0dce5ed9..d74dbae31c9dcbb3ca92c9679792041c8755c5ea 100644
--- a/chrome/browser/extensions/convert_web_app.cc
+++ b/chrome/browser/extensions/convert_web_app.cc
@@ -112,14 +112,23 @@ scoped_refptr<Extension> ConvertWebAppToExtension(
web_app.generated_icon_color));
}
- // Add the icons.
+ // Add the icons and linked icon information.
base::DictionaryValue* icons = new base::DictionaryValue();
root->Set(keys::kIcons, icons);
- for (size_t i = 0; i < web_app.icons.size(); ++i) {
- std::string size = base::StringPrintf("%i", web_app.icons[i].width);
+ base::ListValue* linked_icons = new base::ListValue();
+ root->Set(keys::kLinkedAppIcons, linked_icons);
+ for (const auto& icon : web_app.icons) {
+ std::string size = base::StringPrintf("%i", icon.width);
std::string icon_path = base::StringPrintf("%s/%s.png", kIconsDirName,
size.c_str());
icons->SetString(size, icon_path);
+
+ if (icon.url.is_valid()) {
+ base::DictionaryValue* linked_icon = new base::DictionaryValue();
+ linked_icon->SetString(keys::kLinkedAppIconURL, icon.url.spec());
+ linked_icon->SetInteger(keys::kLinkedAppIconSize, icon.width);
+ linked_icons->Append(linked_icon);
+ }
}
// Write the manifest.

Powered by Google App Engine
This is Rietveld 408576698