1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #import "chrome/browser/ui/cocoa/download/download_show_all_button.h"
7 #include "base/logging.h"
8 #import "chrome/browser/ui/cocoa/download/download_show_all_cell.h"
9 #include "grit/generated_resources.h"
10 #include "grit/theme_resources.h"
11 #include "ui/base/resource/resource_bundle.h"
12 #include "ui/gfx/image/image.h"
14 @implementation DownloadShowAllButton
16 - (void)awakeFromNib {
17 DCHECK([[self cell] isKindOfClass:[DownloadShowAllCell class]]);
18 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
19 NSImage* favicon = rb.GetNativeImageNamed(IDR_DOWNLOADS_FAVICON).ToNSImage();
20 [self setImage:favicon];
23 // GTM's layout tweaker calls sizeToFit to receive the desired width of views.
24 // By default, buttons will be only 14px high, but the Show All button needs to
27 NSRect oldRect = [self frame];
29 NSRect newRect = [self frame];
32 newRect.origin.y = oldRect.origin.y;
33 newRect.size.height = oldRect.size.height;
35 [self setFrame:newRect];