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

Unified Diff: chrome/browser/extensions/bookmark_app_helper.h

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/bookmark_app_helper.h
diff --git a/chrome/browser/extensions/bookmark_app_helper.h b/chrome/browser/extensions/bookmark_app_helper.h
index 3a47947d57f8cb3bad0577848dfc237520312300..52b72ca97bb483c26b14d69c6085c32e01b9e8d1 100644
--- a/chrome/browser/extensions/bookmark_app_helper.h
+++ b/chrome/browser/extensions/bookmark_app_helper.h
@@ -34,6 +34,14 @@ class Extension;
// A helper class for creating bookmark apps from a WebContents.
class BookmarkAppHelper : public content::NotificationObserver {
public:
+ struct BitmapAndSource {
+ BitmapAndSource();
+ ~BitmapAndSource();
+
+ GURL source_url;
+ SkBitmap bitmap;
+ };
+
typedef base::Callback<void(const Extension*, const WebApplicationInfo&)>
CreateBookmarkAppCallback;
@@ -56,14 +64,14 @@ class BookmarkAppHelper : public content::NotificationObserver {
// |sizes| and resizes it to that size. This returns a map of sizes to bitmaps
// which contains only bitmaps of a size in |sizes| and at most one bitmap of
// each size.
- static std::map<int, SkBitmap> ConstrainBitmapsToSizes(
- const std::vector<SkBitmap>& bitmaps,
+ static std::map<int, BitmapAndSource> ConstrainBitmapsToSizes(
+ const std::vector<BitmapAndSource>& bitmaps,
const std::set<int>& sizes);
// Adds a square container icon of |output_size| pixels to |bitmaps| by
// drawing the given |letter| into a rounded background of |color|.
// Does nothing if an icon of |output_size| already exists in |bitmaps|.
- static void GenerateIcon(std::map<int, SkBitmap>* bitmaps,
+ static void GenerateIcon(std::map<int, BitmapAndSource>* bitmaps,
int output_size,
SkColor color,
char letter);

Powered by Google App Engine
This is Rietveld 408576698