diff options
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/cocoa/bookmark_bar_controller.mm | 8 | ||||
-rw-r--r-- | chrome/browser/cocoa/tab_strip_controller.mm | 28 |
2 files changed, 8 insertions, 28 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_controller.mm b/chrome/browser/cocoa/bookmark_bar_controller.mm index ad92820..e30a1a2 100644 --- a/chrome/browser/cocoa/bookmark_bar_controller.mm +++ b/chrome/browser/cocoa/bookmark_bar_controller.mm @@ -10,10 +10,12 @@ #import "chrome/browser/cocoa/bookmark_bar_controller.h" #import "chrome/browser/cocoa/bookmark_bar_view.h" #import "chrome/browser/cocoa/bookmark_button_cell.h" +#import "chrome/browser/cocoa/cocoa_utils.h" #include "chrome/browser/profile.h" #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" -#include "skia/ext/skia_utils_mac.h" + +using namespace CocoaUtils; @interface BookmarkBarController(Private) - (void)applyContentAreaOffset:(BOOL)apply; @@ -165,7 +167,7 @@ const CGFloat kBookmarkHorizontalPadding = 8.0; // (and their icons) are loaded on the IO thread to speed launch. const SkBitmap& favicon = bookmarkModel_->GetFavIcon(node); if (!favicon.isNull()) { - NSImage* image = gfx::SkBitmapToNSImage(favicon); + NSImage* image = SkBitmapToNSImage(favicon); if (image) { [cell setImage:image]; [cell setImagePosition:NSImageLeft]; @@ -293,7 +295,7 @@ const CGFloat kBookmarkHorizontalPadding = 8.0; void* pointer = [[cell representedObject] pointerValue]; BookmarkNode* cellnode = static_cast<BookmarkNode*>(pointer); if (cellnode == node) { - NSImage* image = gfx::SkBitmapToNSImage(bookmarkModel_->GetFavIcon(node)); + NSImage* image = SkBitmapToNSImage(bookmarkModel_->GetFavIcon(node)); if (image) { [cell setImage:image]; [cell setImagePosition:NSImageLeft]; diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm index 67532c8..b54de92 100644 --- a/chrome/browser/cocoa/tab_strip_controller.mm +++ b/chrome/browser/cocoa/tab_strip_controller.mm @@ -5,7 +5,6 @@ #import "chrome/browser/cocoa/tab_strip_controller.h" #include "app/l10n_util.h" -#include "base/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/browser.h" @@ -18,13 +17,10 @@ #import "chrome/browser/cocoa/tab_strip_model_observer_bridge.h" #import "chrome/browser/cocoa/tab_view.h" #import "chrome/browser/cocoa/throbber_view.h" -#include "chrome/browser/tab_contents/navigation_controller.h" -#include "chrome/browser/tab_contents/navigation_entry.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/tab_contents/tab_contents_view.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "grit/generated_resources.h" -#include "skia/ext/skia_utils_mac.h" NSString* const kTabStripNumberOfTabsChanged = @"kTabStripNumberOfTabsChanged"; @@ -420,31 +416,13 @@ NSString* const kTabStripNumberOfTabsChanged = @"kTabStripNumberOfTabsChanged"; // A helper routine for creating an NSImageView to hold the fav icon for // |contents|. +// TODO(pinkerton): fill in with code to use the real favicon, not the default +// for all cases. - (NSImageView*)favIconImageViewForContents:(TabContents*)contents { NSRect iconFrame = NSMakeRect(0, 0, 16, 16); NSImageView* view = [[[NSImageView alloc] initWithFrame:iconFrame] autorelease]; - - NSImage* image = nil; - - NavigationEntry* navEntry = contents->controller().GetLastCommittedEntry(); - if (navEntry != NULL) { - NavigationEntry::FaviconStatus favIcon = navEntry->favicon(); - const SkBitmap& bitmap = favIcon.bitmap(); - if (favIcon.is_valid() && !bitmap.isNull()) - image = gfx::SkBitmapToNSImage(bitmap); - } - - // Either we don't have a valid favicon or there was some issue converting it - // from an SkBitmap. Either way, just show the default. - if (!image) { - NSBundle* bundle = mac_util::MainAppBundle(); - image = [[NSImage alloc] initByReferencingFile: - [bundle pathForResource:@"nav" ofType:@"pdf"]]; - [image autorelease]; - } - - [view setImage:image]; + [view setImage:[NSImage imageNamed:@"nav"]]; return view; } |