OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #import "chrome/browser/ui/cocoa/hover_close_button.h" | 10 #import "chrome/browser/ui/cocoa/hover_close_button.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // The tab has the notion of an "icon view" which can be used to display | 35 // The tab has the notion of an "icon view" which can be used to display |
36 // identifying characteristics such as a favicon, or since it's a full-fledged | 36 // identifying characteristics such as a favicon, or since it's a full-fledged |
37 // view, something with state and animation such as a throbber for illustrating | 37 // view, something with state and animation such as a throbber for illustrating |
38 // progress. The default in the nib is an image view so nothing special is | 38 // progress. The default in the nib is an image view so nothing special is |
39 // required if that's all you need. | 39 // required if that's all you need. |
40 | 40 |
41 @interface TabController : NSViewController<TabDraggingEventTarget> { | 41 @interface TabController : NSViewController<TabDraggingEventTarget> { |
42 @private | 42 @private |
43 base::scoped_nsobject<NSView> iconView_; | 43 base::scoped_nsobject<NSView> iconView_; |
44 base::scoped_nsobject<NSTextField> titleView_; | 44 base::scoped_nsobject<NSTextField> titleView_; |
| 45 base::scoped_nsobject<NSView> audioIndicatorView_; |
45 base::scoped_nsobject<HoverCloseButton> closeButton_; | 46 base::scoped_nsobject<HoverCloseButton> closeButton_; |
46 | 47 |
47 NSRect originalIconFrame_; // frame of iconView_ as loaded from nib | 48 NSRect originalIconFrame_; // frame of iconView_ as loaded from nib |
48 BOOL isIconShowing_; // last state of iconView_ in updateVisibility | 49 BOOL isIconShowing_; // last state of iconView_ in updateVisibility |
49 | 50 |
50 BOOL app_; | 51 BOOL app_; |
51 BOOL mini_; | 52 BOOL mini_; |
52 BOOL pinned_; | 53 BOOL pinned_; |
53 BOOL projecting_; | 54 BOOL projecting_; |
54 BOOL active_; | 55 BOOL active_; |
(...skipping 20 matching lines...) Expand all Loading... |
75 @property(assign, nonatomic) BOOL projecting; | 76 @property(assign, nonatomic) BOOL projecting; |
76 // Note that |-selected| will return YES if the controller is |-active|, too. | 77 // Note that |-selected| will return YES if the controller is |-active|, too. |
77 // |-setSelected:| affects the selection, while |-setActive:| affects the key | 78 // |-setSelected:| affects the selection, while |-setActive:| affects the key |
78 // status/focus of the content. | 79 // status/focus of the content. |
79 @property(assign, nonatomic) BOOL active; | 80 @property(assign, nonatomic) BOOL active; |
80 @property(assign, nonatomic) BOOL selected; | 81 @property(assign, nonatomic) BOOL selected; |
81 @property(assign, nonatomic) id target; | 82 @property(assign, nonatomic) id target; |
82 @property(assign, nonatomic) GURL url; | 83 @property(assign, nonatomic) GURL url; |
83 @property(assign, nonatomic) NSView* iconView; | 84 @property(assign, nonatomic) NSView* iconView; |
84 @property(readonly, nonatomic) NSTextField* titleView; | 85 @property(readonly, nonatomic) NSTextField* titleView; |
| 86 @property(assign, nonatomic) NSView* audioIndicatorView; |
85 @property(readonly, nonatomic) HoverCloseButton* closeButton; | 87 @property(readonly, nonatomic) HoverCloseButton* closeButton; |
86 | 88 |
87 // Minimum and maximum allowable tab width. The minimum width does not show | 89 // Minimum and maximum allowable tab width. The minimum width does not show |
88 // the icon or the close button. The selected tab always has at least a close | 90 // the icon or the close button. The selected tab always has at least a close |
89 // button so it has a different minimum width. | 91 // button so it has a different minimum width. |
90 + (CGFloat)minTabWidth; | 92 + (CGFloat)minTabWidth; |
91 + (CGFloat)maxTabWidth; | 93 + (CGFloat)maxTabWidth; |
92 + (CGFloat)minSelectedTabWidth; | 94 + (CGFloat)minSelectedTabWidth; |
93 + (CGFloat)miniTabWidth; | 95 + (CGFloat)miniTabWidth; |
94 + (CGFloat)appTabWidth; | 96 + (CGFloat)appTabWidth; |
(...skipping 19 matching lines...) Expand all Loading... |
114 - (void)updateVisibility; | 116 - (void)updateVisibility; |
115 | 117 |
116 // Update the title color to match the tabs current state. | 118 // Update the title color to match the tabs current state. |
117 - (void)updateTitleColor; | 119 - (void)updateTitleColor; |
118 @end | 120 @end |
119 | 121 |
120 @interface TabController(TestingAPI) | 122 @interface TabController(TestingAPI) |
121 - (NSString*)toolTip; | 123 - (NSString*)toolTip; |
122 - (int)iconCapacity; | 124 - (int)iconCapacity; |
123 - (BOOL)shouldShowIcon; | 125 - (BOOL)shouldShowIcon; |
| 126 - (BOOL)shouldShowAudioIndicator; |
124 - (BOOL)shouldShowCloseButton; | 127 - (BOOL)shouldShowCloseButton; |
125 @end // TabController(TestingAPI) | 128 @end // TabController(TestingAPI) |
126 | 129 |
127 #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_CONTROLLER_H_ | 130 #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_CONTROLLER_H_ |
OLD | NEW |