Chromium Code Reviews| Index: chrome/browser/ui/cocoa/tab_contents/favicon_util.mm |
| diff --git a/chrome/browser/ui/cocoa/tab_contents/favicon_util.mm b/chrome/browser/ui/cocoa/tab_contents/favicon_util.mm |
| index 390b8f9e2929755a60e0ad6cc67ac3d2b2b5fc13..dd2e17e52b13c1e43bf9dba8531390d91170a661 100644 |
| --- a/chrome/browser/ui/cocoa/tab_contents/favicon_util.mm |
| +++ b/chrome/browser/ui/cocoa/tab_contents/favicon_util.mm |
| @@ -19,8 +19,14 @@ NSImage* FaviconForTabContents(TabContents* contents) { |
| // favicon. |
| if (contents && contents->FaviconIsValid()) { |
| CGColorSpaceRef color_space = base::mac::GetSystemColorSpace(); |
| - return gfx::SkBitmapToNSImageWithColorSpace(contents->GetFavicon(), |
| - color_space); |
| + NSImage* image = |
| + gfx::SkBitmapToNSImageWithColorSpace(contents->GetFavicon(), |
| + color_space); |
| + // The |image| could be nil if the conversion failed. In that case, fallback |
| + // to the default image. |
|
Scott Hess - ex-Googler
2011/04/26 17:55:34
AFAICT, the only way it returns nil is if skiaBitm
Robert Sesek
2011/04/26 18:08:51
I wrote the comment from memory, but you're right.
|
| + if (image) { |
| + return image; |
| + } |
|
Scott Hess - ex-Googler
2011/04/26 17:55:34
Is it just me, or do those {} look extraneous?
Robert Sesek
2011/04/26 18:08:51
I like extraneous braces in this instance because
|
| } |
| return app::mac::GetCachedImageWithName(@"nav.pdf"); |