| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UI_COCOA_TABS_TAB_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_TABS_TAB_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_TABS_TAB_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_TABS_TAB_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 #import "chrome/browser/ui/cocoa/hover_close_button.h" | 10 #import "chrome/browser/ui/cocoa/hover_close_button.h" |
| 11 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 11 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
| 12 #include "googleurl/src/gurl.h" |
| 12 | 13 |
| 13 // The loading/waiting state of the tab. | 14 // The loading/waiting state of the tab. |
| 14 enum TabLoadingState { | 15 enum TabLoadingState { |
| 15 kTabDone, | 16 kTabDone, |
| 16 kTabLoading, | 17 kTabLoading, |
| 17 kTabWaiting, | 18 kTabWaiting, |
| 18 kTabCrashed, | 19 kTabCrashed, |
| 19 }; | 20 }; |
| 20 | 21 |
| 21 @class MenuController; | 22 @class MenuController; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 42 IBOutlet NSTextField* titleView_; | 43 IBOutlet NSTextField* titleView_; |
| 43 IBOutlet HoverCloseButton* closeButton_; | 44 IBOutlet HoverCloseButton* closeButton_; |
| 44 | 45 |
| 45 NSRect originalIconFrame_; // frame of iconView_ as loaded from nib | 46 NSRect originalIconFrame_; // frame of iconView_ as loaded from nib |
| 46 BOOL isIconShowing_; // last state of iconView_ in updateVisibility | 47 BOOL isIconShowing_; // last state of iconView_ in updateVisibility |
| 47 | 48 |
| 48 BOOL app_; | 49 BOOL app_; |
| 49 BOOL mini_; | 50 BOOL mini_; |
| 50 BOOL pinned_; | 51 BOOL pinned_; |
| 51 BOOL selected_; | 52 BOOL selected_; |
| 53 GURL url_; |
| 52 TabLoadingState loadingState_; | 54 TabLoadingState loadingState_; |
| 53 CGFloat iconTitleXOffset_; // between left edges of icon and title | 55 CGFloat iconTitleXOffset_; // between left edges of icon and title |
| 54 id<TabControllerTarget> target_; // weak, where actions are sent | 56 id<TabControllerTarget> target_; // weak, where actions are sent |
| 55 SEL action_; // selector sent when tab is selected by clicking | 57 SEL action_; // selector sent when tab is selected by clicking |
| 56 scoped_ptr<TabMenuModel> contextMenuModel_; | 58 scoped_ptr<TabMenuModel> contextMenuModel_; |
| 57 scoped_ptr<TabControllerInternal::MenuDelegate> contextMenuDelegate_; | 59 scoped_ptr<TabControllerInternal::MenuDelegate> contextMenuDelegate_; |
| 58 scoped_nsobject<MenuController> contextMenuController_; | 60 scoped_nsobject<MenuController> contextMenuController_; |
| 59 } | 61 } |
| 60 | 62 |
| 61 @property(assign, nonatomic) TabLoadingState loadingState; | 63 @property(assign, nonatomic) TabLoadingState loadingState; |
| 62 | 64 |
| 63 @property(assign, nonatomic) SEL action; | 65 @property(assign, nonatomic) SEL action; |
| 64 @property(assign, nonatomic) BOOL app; | 66 @property(assign, nonatomic) BOOL app; |
| 65 @property(assign, nonatomic) BOOL mini; | 67 @property(assign, nonatomic) BOOL mini; |
| 66 @property(assign, nonatomic) BOOL pinned; | 68 @property(assign, nonatomic) BOOL pinned; |
| 67 @property(assign, nonatomic) BOOL selected; | 69 @property(assign, nonatomic) BOOL selected; |
| 68 @property(assign, nonatomic) id target; | 70 @property(assign, nonatomic) id target; |
| 71 @property(assign, nonatomic) GURL url; |
| 69 @property(assign, nonatomic) NSView* iconView; | 72 @property(assign, nonatomic) NSView* iconView; |
| 70 @property(assign, nonatomic) NSTextField* titleView; | 73 @property(assign, nonatomic) NSTextField* titleView; |
| 71 @property(assign, nonatomic) HoverCloseButton* closeButton; | 74 @property(assign, nonatomic) HoverCloseButton* closeButton; |
| 72 | 75 |
| 73 // Minimum and maximum allowable tab width. The minimum width does not show | 76 // Minimum and maximum allowable tab width. The minimum width does not show |
| 74 // the icon or the close button. The selected tab always has at least a close | 77 // the icon or the close button. The selected tab always has at least a close |
| 75 // button so it has a different minimum width. | 78 // button so it has a different minimum width. |
| 76 + (CGFloat)minTabWidth; | 79 + (CGFloat)minTabWidth; |
| 77 + (CGFloat)maxTabWidth; | 80 + (CGFloat)maxTabWidth; |
| 78 + (CGFloat)minSelectedTabWidth; | 81 + (CGFloat)minSelectedTabWidth; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 @end | 114 @end |
| 112 | 115 |
| 113 @interface TabController(TestingAPI) | 116 @interface TabController(TestingAPI) |
| 114 - (NSString*)toolTip; | 117 - (NSString*)toolTip; |
| 115 - (int)iconCapacity; | 118 - (int)iconCapacity; |
| 116 - (BOOL)shouldShowIcon; | 119 - (BOOL)shouldShowIcon; |
| 117 - (BOOL)shouldShowCloseButton; | 120 - (BOOL)shouldShowCloseButton; |
| 118 @end // TabController(TestingAPI) | 121 @end // TabController(TestingAPI) |
| 119 | 122 |
| 120 #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_CONTROLLER_H_ | 123 #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_CONTROLLER_H_ |
| OLD | NEW |