summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/tab_strip_controller.mm
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-04 00:44:46 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-04 00:44:46 +0000
commit097494c2e956f97094f1d76b5bf5788dab5f8c6b (patch)
tree3fc7958e9df5d83845787f37825e6d2af95a4408 /chrome/browser/cocoa/tab_strip_controller.mm
parent95852502aefcebaae577a6bceef69f81755acc25 (diff)
downloadchromium_src-097494c2e956f97094f1d76b5bf5788dab5f8c6b.zip
chromium_src-097494c2e956f97094f1d76b5bf5788dab5f8c6b.tar.gz
chromium_src-097494c2e956f97094f1d76b5bf5788dab5f8c6b.tar.bz2
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 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33758 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/tab_strip_controller.mm')
-rw-r--r--chrome/browser/cocoa/tab_strip_controller.mm13
1 files changed, 7 insertions, 6 deletions
diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm
index b6f2573..54b908a 100644
--- a/chrome/browser/cocoa/tab_strip_controller.mm
+++ b/chrome/browser/cocoa/tab_strip_controller.mm
@@ -265,17 +265,18 @@ 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]);
- // 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]]);
+ // 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];
[self addSubviewToPermanentList:newTabButton_];
[newTabButton_ setTarget:nil];
[newTabButton_ setAction:@selector(commandDispatch:)];