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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 std::vector<gfx::ImageSkiaRep> image_reps = | 201 std::vector<gfx::ImageSkiaRep> image_reps = |
202 info_.favicon.ToImageSkia()->image_reps(); | 202 info_.favicon.ToImageSkia()->GetRepresentations(); |
203 for (size_t i = 0; i < image_reps.size(); ++i) { | 203 for (size_t i = 0; i < image_reps.size(); ++i) { |
204 NSBitmapImageRep* image_rep = SkBitmapToImageRep( | 204 NSBitmapImageRep* image_rep = SkBitmapToImageRep( |
205 image_reps[i].sk_bitmap()); | 205 image_reps[i].sk_bitmap()); |
206 if (!image_rep) | 206 if (!image_rep) |
207 continue; | 207 continue; |
208 | 208 |
209 // Missing an icon size is not fatal so don't fail if adding the bitmap | 209 // Missing an icon size is not fatal so don't fail if adding the bitmap |
210 // doesn't work. | 210 // doesn't work. |
211 if (!AddBitmapImageRepToIconFamily(icon_family, image_rep)) | 211 if (!AddBitmapImageRepToIconFamily(icon_family, image_rep)) |
212 continue; | 212 continue; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 } | 263 } |
264 | 264 |
265 void DeletePlatformShortcuts(const FilePath& profile_path, | 265 void DeletePlatformShortcuts(const FilePath& profile_path, |
266 const std::string& extension_id) { | 266 const std::string& extension_id) { |
267 // TODO(benwells): Implement this when shortcuts / weblings are enabled on | 267 // TODO(benwells): Implement this when shortcuts / weblings are enabled on |
268 // mac. | 268 // mac. |
269 } | 269 } |
270 | 270 |
271 } // namespace internals | 271 } // namespace internals |
272 } // namespace web_app | 272 } // namespace web_app |
OLD | NEW |