OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "chrome/browser/web_applications/web_app_mac.h" | 5 #import "chrome/browser/web_applications/web_app_mac.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 forKey:app_mode::kCrAppModeExtensionPathKey]; | 191 forKey:app_mode::kCrAppModeExtensionPathKey]; |
192 return [plist writeToFile:plist_path atomically:YES]; | 192 return [plist writeToFile:plist_path atomically:YES]; |
193 } | 193 } |
194 | 194 |
195 bool WebAppShortcutCreator::UpdateIcon(const FilePath& app_path) const { | 195 bool WebAppShortcutCreator::UpdateIcon(const FilePath& app_path) const { |
196 if (info_.favicon.IsEmpty()) | 196 if (info_.favicon.IsEmpty()) |
197 return true; | 197 return true; |
198 | 198 |
199 scoped_nsobject<IconFamily> icon_family([[IconFamily alloc] init]); | 199 scoped_nsobject<IconFamily> icon_family([[IconFamily alloc] init]); |
200 bool image_added = false; | 200 bool image_added = false; |
| 201 info_.favicon.ToImageSkia()->EnsureRepsForSupportedScaleFactors(); |
201 std::vector<gfx::ImageSkiaRep> image_reps = | 202 std::vector<gfx::ImageSkiaRep> image_reps = |
202 info_.favicon.ToImageSkia()->GetRepresentations(); | 203 info_.favicon.ToImageSkia()->image_reps(); |
203 for (size_t i = 0; i < image_reps.size(); ++i) { | 204 for (size_t i = 0; i < image_reps.size(); ++i) { |
204 NSBitmapImageRep* image_rep = SkBitmapToImageRep( | 205 NSBitmapImageRep* image_rep = SkBitmapToImageRep( |
205 image_reps[i].sk_bitmap()); | 206 image_reps[i].sk_bitmap()); |
206 if (!image_rep) | 207 if (!image_rep) |
207 continue; | 208 continue; |
208 | 209 |
209 // Missing an icon size is not fatal so don't fail if adding the bitmap | 210 // Missing an icon size is not fatal so don't fail if adding the bitmap |
210 // doesn't work. | 211 // doesn't work. |
211 if (!AddBitmapImageRepToIconFamily(icon_family, image_rep)) | 212 if (!AddBitmapImageRepToIconFamily(icon_family, image_rep)) |
212 continue; | 213 continue; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 264 |
264 void DeletePlatformShortcuts( | 265 void DeletePlatformShortcuts( |
265 const FilePath& web_app_path, | 266 const FilePath& web_app_path, |
266 const ShellIntegration::ShortcutInfo& shortcut_info) { | 267 const ShellIntegration::ShortcutInfo& shortcut_info) { |
267 // TODO(benwells): Implement this when shortcuts / weblings are enabled on | 268 // TODO(benwells): Implement this when shortcuts / weblings are enabled on |
268 // mac. | 269 // mac. |
269 } | 270 } |
270 | 271 |
271 } // namespace internals | 272 } // namespace internals |
272 } // namespace web_app | 273 } // namespace web_app |
OLD | NEW |