diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-04 00:57:21 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-04 00:57:21 +0000 |
commit | e4929565ffe17e5ca6bbb4ac2cb2fdd86ea40760 (patch) | |
tree | 75ebfed89c5b7027d4cac7f927a4765d7c51ab61 /chrome/browser | |
parent | ab3e58a2ed17a8c6d5901c4b5dcb7875c681932d (diff) | |
download | chromium_src-e4929565ffe17e5ca6bbb4ac2cb2fdd86ea40760.zip chromium_src-e4929565ffe17e5ca6bbb4ac2cb2fdd86ea40760.tar.gz chromium_src-e4929565ffe17e5ca6bbb4ac2cb2fdd86ea40760.tar.bz2 |
Revert 33758 - Mac: remove hacky way the New Tab button is obtained from the nib.
I added a member variable and an accessor/mutator ... and hooked up that up in
the nib. Changes to BrowserWindow.xib: hook up the New Tab button to
|newTabButton| in TabBar.
BUG=none
TEST=Make sure it builds, runs, and that the New Tab button still works.
Review URL: http://codereview.chromium.org/465042
TBR=viettrungluu@chromium.org
Review URL: http://codereview.chromium.org/465045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33761 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/cocoa/tab_strip_controller.mm | 13 | ||||
-rw-r--r-- | chrome/browser/cocoa/tab_strip_view.h | 6 | ||||
-rw-r--r-- | chrome/browser/cocoa/tab_strip_view.mm | 2 |
3 files changed, 6 insertions, 15 deletions
diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm index 54b908a..b6f2573 100644 --- a/chrome/browser/cocoa/tab_strip_controller.mm +++ b/chrome/browser/cocoa/tab_strip_controller.mm @@ -265,18 +265,17 @@ private: bridge_.reset(new TabStripModelObserverBridge(tabModel_, self)); tabContentsArray_.reset([[NSMutableArray alloc] init]); tabArray_.reset([[NSMutableArray alloc] init]); - - // Important note: any non-tab subviews not added to |permanentSubviews_| - // (see |-addSubviewToPermanentList:|) will be wiped out. permanentSubviews_.reset([[NSMutableArray alloc] init]); ResourceBundle& rb = ResourceBundle::GetSharedInstance(); defaultFavIcon_.reset([rb.GetNSImageNamed(IDR_DEFAULT_FAVICON) retain]); - // TODO(viettrungluu): WTF? "For some reason, if the view is present in the - // nib a priori, it draws correctly. If we create it in code and add it to - // the tab view, it draws with all sorts of crazy artifacts." - newTabButton_ = [view newTabButton]; + // 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 + // with all sorts of crazy artifacts. + newTabButton_ = [[tabView_ subviews] objectAtIndex:0]; + DCHECK([newTabButton_ isKindOfClass:[NSButton class]]); [self addSubviewToPermanentList:newTabButton_]; [newTabButton_ setTarget:nil]; [newTabButton_ setAction:@selector(commandDispatch:)]; diff --git a/chrome/browser/cocoa/tab_strip_view.h b/chrome/browser/cocoa/tab_strip_view.h index c93ea8c..dd8fbd7 100644 --- a/chrome/browser/cocoa/tab_strip_view.h +++ b/chrome/browser/cocoa/tab_strip_view.h @@ -12,13 +12,7 @@ @interface TabStripView : NSView { @private NSTimeInterval lastMouseUp_; - - // Weak; the following come from the nib. - NSButton* newTabButton_; } - -@property(assign, nonatomic) IBOutlet NSButton* newTabButton; - @end #endif // CHROME_BROWSER_COCOA_TAB_STRIP_VIEW_H_ diff --git a/chrome/browser/cocoa/tab_strip_view.mm b/chrome/browser/cocoa/tab_strip_view.mm index f2638dc..398e6a3 100644 --- a/chrome/browser/cocoa/tab_strip_view.mm +++ b/chrome/browser/cocoa/tab_strip_view.mm @@ -8,8 +8,6 @@ @implementation TabStripView -@synthesize newTabButton = newTabButton_; - - (id)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { |