summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/app/nibs/BrowserWindow.xib20
-rw-r--r--chrome/browser/cocoa/tab_strip_controller.mm13
-rw-r--r--chrome/browser/cocoa/tab_strip_view.h6
-rw-r--r--chrome/browser/cocoa/tab_strip_view.mm2
4 files changed, 31 insertions, 10 deletions
diff --git a/chrome/app/nibs/BrowserWindow.xib b/chrome/app/nibs/BrowserWindow.xib
index 5baa20f..ce1373f 100644
--- a/chrome/app/nibs/BrowserWindow.xib
+++ b/chrome/app/nibs/BrowserWindow.xib
@@ -2,10 +2,10 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1050</int>
- <string key="IBDocument.SystemVersion">10B504</string>
+ <string key="IBDocument.SystemVersion">10C540</string>
<string key="IBDocument.InterfaceBuilderVersion">740</string>
- <string key="IBDocument.AppKitVersion">1038.2</string>
- <string key="IBDocument.HIToolboxVersion">437.00</string>
+ <string key="IBDocument.AppKitVersion">1038.25</string>
+ <string key="IBDocument.HIToolboxVersion">458.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">740</string>
@@ -147,6 +147,14 @@
</object>
<int key="connectionID">86</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">newTabButton</string>
+ <reference key="source" ref="1029219716"/>
+ <reference key="destination" ref="131944810"/>
+ </object>
+ <int key="connectionID">87</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -295,7 +303,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">86</int>
+ <int key="maxID">87</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -368,6 +376,10 @@
<object class="IBPartialClassDescription">
<string key="className">TabStripView</string>
<string key="superclassName">NSView</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">newTabButton</string>
+ <string key="NS.object.0">NSButton</string>
+ </object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">browser/cocoa/tab_strip_view.h</string>
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:)];
diff --git a/chrome/browser/cocoa/tab_strip_view.h b/chrome/browser/cocoa/tab_strip_view.h
index dd8fbd7..c93ea8c 100644
--- a/chrome/browser/cocoa/tab_strip_view.h
+++ b/chrome/browser/cocoa/tab_strip_view.h
@@ -12,7 +12,13 @@
@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 398e6a3..f2638dc 100644
--- a/chrome/browser/cocoa/tab_strip_view.mm
+++ b/chrome/browser/cocoa/tab_strip_view.mm
@@ -8,6 +8,8 @@
@implementation TabStripView
+@synthesize newTabButton = newTabButton_;
+
- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
if (self) {