| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_COCOA_TAB_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_COCOA_TAB_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_COCOA_TAB_CONTROLLER_H_ | 6 #define CHROME_BROWSER_COCOA_TAB_CONTROLLER_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 @class TabView; | 10 @class TabView; |
| 11 @protocol TabControllerTarget; | 11 @protocol TabControllerTarget; |
| 12 | 12 |
| 13 // A class that manages a single tab in the tab strip. Set its target/action | 13 // A class that manages a single tab in the tab strip. Set its target/action |
| 14 // to be sent a message when the tab is selected by the user clicking. Setting | 14 // to be sent a message when the tab is selected by the user clicking. Setting |
| 15 // the |loading| property to YES visually indicates that this tab is currently | 15 // the |loading| property to YES visually indicates that this tab is currently |
| 16 // loading content via a spinner. | 16 // loading content via a spinner. |
| 17 | 17 |
| 18 @interface TabController : NSViewController { | 18 @interface TabController : NSViewController { |
| 19 @private | 19 @private |
| 20 IBOutlet NSButton *backgroundButton_; | 20 IBOutlet NSButton *backgroundButton_; |
| 21 IBOutlet NSProgressIndicator *progressIndicator_; | 21 IBOutlet NSProgressIndicator *progressIndicator_; |
| 22 BOOL selected_; | 22 BOOL selected_; |
| 23 BOOL loading_; | 23 BOOL loading_; |
| 24 NSImage *image_; | 24 NSImage *image_; |
| 25 id<TabControllerTarget> target_; // weak, where actions are sent | 25 id<TabControllerTarget> target_; // weak, where actions are sent |
| 26 SEL action_; // selector sent when tab is selected by clicking | 26 SEL action_; // selector sent when tab is seleted by clicking |
| 27 } | 27 } |
| 28 | 28 |
| 29 @property(retain, nonatomic) NSImage *image; | 29 @property(retain, nonatomic) NSImage *image; |
| 30 @property(assign, nonatomic) BOOL selected; | 30 @property(assign, nonatomic) BOOL selected; |
| 31 @property(assign, nonatomic) BOOL loading; | 31 @property(assign, nonatomic) BOOL loading; |
| 32 @property(assign, nonatomic) id target; | 32 @property(assign, nonatomic) id target; |
| 33 @property(assign, nonatomic) SEL action; | 33 @property(assign, nonatomic) SEL action; |
| 34 | 34 |
| 35 // Minimum and maximum allowable tab width. | 35 // Minimum and maximum allowable tab width. |
| 36 + (float)minTabWidth; | 36 + (float)minTabWidth; |
| 37 + (float)maxTabWidth; | 37 + (float)maxTabWidth; |
| 38 | 38 |
| 39 // The view associated with this controller, pre-casted as a TabView | 39 // The view associated with this controller, pre-casted as a TabView |
| 40 - (TabView *)tabView; | 40 - (TabView *)tabView; |
| 41 | 41 |
| 42 // Closes the associated TabView by relaying the message to |target_| to | 42 // Closes the associated TabView by relaying the message to |target_| to |
| 43 // perform the close. | 43 // perform the close. |
| 44 - (IBAction)closeTab:(id)sender; | 44 - (IBAction)closeTab:(id)sender; |
| 45 | 45 |
| 46 @end | 46 @end |
| 47 | 47 |
| 48 #endif // CHROME_BROWSER_COCOA_TAB_CONTROLLER_H_ | 48 #endif // CHROME_BROWSER_COCOA_TAB_CONTROLLER_H_ |
| OLD | NEW |