OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <AppKit/AppKit.h> | 5 #import <AppKit/AppKit.h> |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/nsimage_cache_mac.h" | 9 #include "app/mac/nsimage_cache.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
11 #import "chrome/browser/app_controller_mac.h" | 11 #import "chrome/browser/app_controller_mac.h" |
12 #include "chrome/browser/bookmarks/bookmark_model.h" | 12 #include "chrome/browser/bookmarks/bookmark_model.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
16 #include "chrome/browser/ui/browser_list.h" | 16 #include "chrome/browser/ui/browser_list.h" |
17 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h" | 17 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h" |
18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h" | 18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h" |
19 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 NSImage* favicon = nil; | 231 NSImage* favicon = nil; |
232 BookmarkModel* model = GetBookmarkModel(); | 232 BookmarkModel* model = GetBookmarkModel(); |
233 if (model) { | 233 if (model) { |
234 const SkBitmap& bitmap = model->GetFavIcon(node); | 234 const SkBitmap& bitmap = model->GetFavIcon(node); |
235 if (!bitmap.isNull()) | 235 if (!bitmap.isNull()) |
236 favicon = gfx::SkBitmapToNSImage(bitmap); | 236 favicon = gfx::SkBitmapToNSImage(bitmap); |
237 } | 237 } |
238 // Either we do not have a loaded favicon or the conversion from SkBitmap | 238 // Either we do not have a loaded favicon or the conversion from SkBitmap |
239 // failed. Use the default site image instead. | 239 // failed. Use the default site image instead. |
240 if (!favicon) | 240 if (!favicon) |
241 favicon = nsimage_cache::ImageNamed(@"nav.pdf"); | 241 favicon = app::mac::GetCachedImageWithName(@"nav.pdf"); |
242 [item setImage:favicon]; | 242 [item setImage:favicon]; |
243 } | 243 } |
244 | 244 |
245 NSMenuItem* BookmarkMenuBridge::MenuItemForNode(const BookmarkNode* node) { | 245 NSMenuItem* BookmarkMenuBridge::MenuItemForNode(const BookmarkNode* node) { |
246 if (!node) | 246 if (!node) |
247 return nil; | 247 return nil; |
248 std::map<const BookmarkNode*, NSMenuItem*>::iterator it = | 248 std::map<const BookmarkNode*, NSMenuItem*>::iterator it = |
249 bookmark_nodes_.find(node); | 249 bookmark_nodes_.find(node); |
250 if (it == bookmark_nodes_.end()) | 250 if (it == bookmark_nodes_.end()) |
251 return nil; | 251 return nil; |
252 return it->second; | 252 return it->second; |
253 } | 253 } |
OLD | NEW |