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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm

Issue 5961007: Move nsimage_cache from base to app/mac. Use the app::mac namespace. Update c... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 12 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm ('k') | chrome/browser/ui/cocoa/browser_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698