diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-06 20:20:47 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-06 20:20:47 +0000 |
commit | 04d125c3a88913f78a70d183130d0ea0af447a50 (patch) | |
tree | 4f5173f28e6a152da5209b9f2bc5d436f7e792bf /chrome | |
parent | 4dfbc7c95d96ed3e1177a737afef41076a0b7683 (diff) | |
download | chromium_src-04d125c3a88913f78a70d183130d0ea0af447a50.zip chromium_src-04d125c3a88913f78a70d183130d0ea0af447a50.tar.gz chromium_src-04d125c3a88913f78a70d183130d0ea0af447a50.tar.bz2 |
Mac: show correct default favicon in tab strip.
We should show the "blank page" favicon for pages which don't have their own (this favicon is used everywhere else for this purpose), not the "globe" (nav.pdf) favicon.
BUG=26953
TEST=Go to, e.g., "about:blank" and check the favicon in the tab in the tab strip.
Review URL: http://codereview.chromium.org/373012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31283 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/cocoa/tab_strip_controller.h | 3 | ||||
-rw-r--r-- | chrome/browser/cocoa/tab_strip_controller.mm | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/cocoa/tab_strip_controller.h b/chrome/browser/cocoa/tab_strip_controller.h index 3a3f5d06..eacad13 100644 --- a/chrome/browser/cocoa/tab_strip_controller.h +++ b/chrome/browser/cocoa/tab_strip_controller.h @@ -88,6 +88,9 @@ class ToolbarModel; // such as the new-tab button, but *not* the tabs themselves. scoped_nsobject<NSMutableArray> permanentSubviews_; + // The default favicon, so we can use one copy for all buttons. + scoped_nsobject<NSImage> defaultFavIcon_; + // Manages per-tab sheets. scoped_nsobject<GTMWindowSheetController> sheetController_; } diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm index 916e659..33fd937 100644 --- a/chrome/browser/cocoa/tab_strip_controller.mm +++ b/chrome/browser/cocoa/tab_strip_controller.mm @@ -217,6 +217,9 @@ static const NSTimeInterval kAnimationDuration = 0.2; tabArray_.reset([[NSMutableArray alloc] init]); permanentSubviews_.reset([[NSMutableArray alloc] init]); + ResourceBundle& rb = ResourceBundle::GetSharedInstance(); + defaultFavIcon_.reset([rb.GetNSImageNamed(IDR_DEFAULT_FAVICON) retain]); + // Take the only child view present in the nib as the new tab button. For // some reason, if the view is present in the nib apriori, it draws // correctly. If we create it in code and add it to the tab view, it draws @@ -935,9 +938,8 @@ static const NSTimeInterval kAnimationDuration = 0.2; // 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) { - image = nsimage_cache::ImageNamed(@"nav.pdf"); - } + if (!image) + image = defaultFavIcon_.get(); [view setImage:image]; return view; |