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

Unified Diff: chrome/browser/web_applications/web_app_mac.mm

Issue 12881003: ShortcutInfo::favicon is now a gfx::ImageFamily instead of gfx::Image. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added test suite for icon_family. Created 7 years, 9 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
« no previous file with comments | « chrome/browser/web_applications/web_app.h ('k') | chrome/browser/web_applications/web_app_mac_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/web_applications/web_app_mac.mm
diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm
index 2c6154800a6a4b4f57b95639328c727be7316053..a73f88fe92489862a7b4998f1c1a49a3e9e738e9 100644
--- a/chrome/browser/web_applications/web_app_mac.mm
+++ b/chrome/browser/web_applications/web_app_mac.mm
@@ -24,6 +24,7 @@
#include "skia/ext/skia_utils_mac.h"
#include "third_party/icon_family/IconFamily.h"
#include "ui/base/l10n/l10n_util_mac.h"
+#include "ui/gfx/icon_family.h"
#include "ui/gfx/image/image_skia.h"
namespace {
@@ -197,17 +198,17 @@ bool WebAppShortcutCreator::UpdatePlist(const base::FilePath& app_path) const {
}
bool WebAppShortcutCreator::UpdateIcon(const base::FilePath& app_path) const {
- if (info_.favicon.IsEmpty())
+ if (info_.favicon.empty())
return true;
scoped_nsobject<IconFamily> icon_family([[IconFamily alloc] init]);
bool image_added = false;
- info_.favicon.ToImageSkia()->EnsureRepsForSupportedScaleFactors();
- std::vector<gfx::ImageSkiaRep> image_reps =
- info_.favicon.ToImageSkia()->image_reps();
- for (size_t i = 0; i < image_reps.size(); ++i) {
- NSBitmapImageRep* image_rep = SkBitmapToImageRep(
- image_reps[i].sk_bitmap());
+ for (gfx::IconFamily::const_iterator it = info_.favicon.begin();
+ it != info_.favicon.end(); ++it) {
+ // TODO(mgiuca): Do we want to do this? DO NOT SUBMIT.
+ // it->EnsureRepsForSupportedScaleFactors();
+ const SkBitmap& bitmap = *it->bitmap();
+ NSBitmapImageRep* image_rep = SkBitmapToImageRep(bitmap);
pkotwicz 2013/03/20 22:19:52 There is one case where |favicon| can have an Imag
if (!image_rep)
continue;
« no previous file with comments | « chrome/browser/web_applications/web_app.h ('k') | chrome/browser/web_applications/web_app_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698