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 #import "chrome/browser/cocoa/hover_close_button.h" | 9 #import "chrome/browser/cocoa/hover_close_button.h" |
10 #include "chrome/browser/tab_menu_model.h" | 10 #include "chrome/browser/tab_menu_model.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 // identifying characteristics such as a favicon, or since it's a full-fledged | 33 // identifying characteristics such as a favicon, or since it's a full-fledged |
34 // view, something with state and animation such as a throbber for illustrating | 34 // view, something with state and animation such as a throbber for illustrating |
35 // progress. The default in the nib is an image view so nothing special is | 35 // progress. The default in the nib is an image view so nothing special is |
36 // required if that's all you need. | 36 // required if that's all you need. |
37 | 37 |
38 @interface TabController : NSViewController { | 38 @interface TabController : NSViewController { |
39 @private | 39 @private |
40 IBOutlet NSView* iconView_; | 40 IBOutlet NSView* iconView_; |
41 IBOutlet NSTextField* titleView_; | 41 IBOutlet NSTextField* titleView_; |
42 IBOutlet HoverCloseButton* closeButton_; | 42 IBOutlet HoverCloseButton* closeButton_; |
| 43 NSTimeInterval closeButtonRevealTime_; |
43 | 44 |
44 NSRect originalIconFrame_; // frame of iconView_ as loaded from nib | 45 NSRect originalIconFrame_; // frame of iconView_ as loaded from nib |
45 BOOL isIconShowing_; // last state of iconView_ in updateVisibility | 46 BOOL isIconShowing_; // last state of iconView_ in updateVisibility |
46 BOOL selected_; | 47 BOOL selected_; |
47 BOOL pinned_; | 48 BOOL pinned_; |
48 TabLoadingState loadingState_; | 49 TabLoadingState loadingState_; |
49 CGFloat iconTitleXOffset_; // between left edges of icon and title | 50 CGFloat iconTitleXOffset_; // between left edges of icon and title |
50 CGFloat titleCloseWidthOffset_; // between right edges of icon and close btn. | 51 CGFloat titleTabOffset_; // between right edge of title and tab end |
51 id<TabControllerTarget> target_; // weak, where actions are sent | 52 id<TabControllerTarget> target_; // weak, where actions are sent |
52 SEL action_; // selector sent when tab is selected by clicking | 53 SEL action_; // selector sent when tab is selected by clicking |
53 scoped_ptr<TabMenuModel> contextMenuModel_; | 54 scoped_ptr<TabMenuModel> contextMenuModel_; |
54 scoped_ptr<TabControllerInternal::MenuDelegate> contextMenuDelegate_; | 55 scoped_ptr<TabControllerInternal::MenuDelegate> contextMenuDelegate_; |
55 scoped_nsobject<MenuController> contextMenuController_; | 56 scoped_nsobject<MenuController> contextMenuController_; |
56 } | 57 } |
57 | 58 |
58 @property(assign, nonatomic) TabLoadingState loadingState; | 59 @property(assign, nonatomic) TabLoadingState loadingState; |
59 | 60 |
60 @property(assign, nonatomic) BOOL selected; | 61 @property(assign, nonatomic) BOOL selected; |
(...skipping 26 matching lines...) Expand all Loading... |
87 // Ideally, tabs would know about their own animation and wouldn't need this. | 88 // Ideally, tabs would know about their own animation and wouldn't need this. |
88 - (BOOL)inRapidClosureMode; | 89 - (BOOL)inRapidClosureMode; |
89 | 90 |
90 // Updates the visibility of certain subviews, such as the icon and close | 91 // Updates the visibility of certain subviews, such as the icon and close |
91 // button, based on criteria such as the tab's selected state and its current | 92 // button, based on criteria such as the tab's selected state and its current |
92 // width. | 93 // width. |
93 - (void)updateVisibility; | 94 - (void)updateVisibility; |
94 | 95 |
95 // Update the title color to match the tabs current state. | 96 // Update the title color to match the tabs current state. |
96 - (void)updateTitleColor; | 97 - (void)updateTitleColor; |
| 98 |
| 99 - (BOOL)closeButtonActive; |
97 @end | 100 @end |
98 | 101 |
99 @interface TabController(TestingAPI) | 102 @interface TabController(TestingAPI) |
100 - (NSString*)toolTip; | 103 - (NSString*)toolTip; |
101 - (int)iconCapacity; | 104 - (int)iconCapacity; |
102 - (BOOL)shouldShowIcon; | |
103 - (BOOL)shouldShowCloseButton; | |
104 @end // TabController(TestingAPI) | 105 @end // TabController(TestingAPI) |
105 | 106 |
106 #endif // CHROME_BROWSER_COCOA_TAB_CONTROLLER_H_ | 107 #endif // CHROME_BROWSER_COCOA_TAB_CONTROLLER_H_ |
OLD | NEW |