| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #import "base/cocoa_protocols_mac.h" | 7 #import "base/cocoa_protocols_mac.h" |
| 8 #include "base/scoped_nsobject.h" |
| 8 | 9 |
| 9 // TabViewPickerTable is an NSTableView that can be used to switch between the | 10 // TabViewPickerTable is an NSOutlineView that can be used to switch between the |
| 10 // NSTabViewItems of an NSTabView. To use this, just create a | 11 // NSTabViewItems of an NSTabView. To use this, just create a |
| 11 // TabViewPickerTable in Interface Builder and connect the |tabView_| outlet | 12 // TabViewPickerTable in Interface Builder and connect the |tabView_| outlet |
| 12 // to an NSTabView. Now the table is automatically populated with the tab labels | 13 // to an NSTabView. Now the table is automatically populated with the tab labels |
| 13 // of the tab view, clicking the table updates the tab view, and switching | 14 // of the tab view, clicking the table updates the tab view, and switching |
| 14 // tab view items updates the selection of the table. | 15 // tab view items updates the selection of the table. |
| 15 @interface TabViewPickerTable : NSTableView <NSTabViewDelegate, | 16 @interface TabViewPickerTable : NSOutlineView <NSTabViewDelegate, |
| 16 NSTableViewDelegate, | 17 NSOutlineViewDelegate, |
| 17 NSTableViewDataSource> { | 18 NSOutlineViewDataSource> { |
| 18 @public | 19 @public |
| 19 IBOutlet NSTabView* tabView_; // Visible for testing. | 20 IBOutlet NSTabView* tabView_; // Visible for testing. |
| 20 | 21 |
| 21 @private | 22 @private |
| 22 id oldTabViewDelegate_; | 23 id oldTabViewDelegate_; |
| 24 |
| 25 // Shown above all the tab names. May be |nil|. |
| 26 scoped_nsobject<NSString> heading_; |
| 23 } | 27 } |
| 28 @property (nonatomic, copy) NSString* heading; |
| 24 @end | 29 @end |
| OLD | NEW |