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_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_TABS_TAB_VIEW_H_ |
6 #define CHROME_BROWSER_UI_COCOA_TABS_TAB_VIEW_H_ | 6 #define CHROME_BROWSER_UI_COCOA_TABS_TAB_VIEW_H_ |
7 | 7 |
8 #include <ApplicationServices/ApplicationServices.h> | 8 #include <ApplicationServices/ApplicationServices.h> |
9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
10 | 10 |
11 #include "base/mac/scoped_cftyperef.h" | 11 #include "base/mac/scoped_cftyperef.h" |
12 #include "base/mac/scoped_nsobject.h" | 12 #include "base/mac/scoped_nsobject.h" |
13 #import "chrome/browser/ui/cocoa/hover_close_button.h" | 13 #import "chrome/browser/ui/cocoa/hover_close_button.h" |
| 14 #import "chrome/browser/ui/cocoa/themed_window.h" |
14 | 15 |
15 namespace tabs { | 16 namespace tabs { |
16 | 17 |
17 // Nomenclature: | 18 // Nomenclature: |
18 // Tabs _glow_ under two different circumstances, when they are _hovered_ (by | 19 // Tabs _glow_ under two different circumstances, when they are _hovered_ (by |
19 // the mouse) and when they are _alerted_ (to show that the tab's title has | 20 // the mouse) and when they are _alerted_ (to show that the tab's title has |
20 // changed). | 21 // changed). |
21 | 22 |
22 // The state of alerting (to show a title change on an unselected, pinned tab). | 23 // The state of alerting (to show a title change on an unselected, pinned tab). |
23 // This is more complicated than a simple on/off since we want to allow the | 24 // This is more complicated than a simple on/off since we want to allow the |
(...skipping 11 matching lines...) Expand all Loading... |
35 const CGFloat kImageNoFocusAlpha = 0.65; | 36 const CGFloat kImageNoFocusAlpha = 0.65; |
36 | 37 |
37 } // namespace tabs | 38 } // namespace tabs |
38 | 39 |
39 @class TabController, TabWindowController, GTMFadeTruncatingTextFieldCell; | 40 @class TabController, TabWindowController, GTMFadeTruncatingTextFieldCell; |
40 | 41 |
41 // A view that handles the event tracking (clicking and dragging) for a tab | 42 // A view that handles the event tracking (clicking and dragging) for a tab |
42 // on the tab strip. Relies on an associated TabController to provide a | 43 // on the tab strip. Relies on an associated TabController to provide a |
43 // target/action for selecting the tab. | 44 // target/action for selecting the tab. |
44 | 45 |
45 @interface TabView : NSView { | 46 @interface TabView : NSView<ThemedWindowDrawing> { |
46 @private | 47 @private |
47 TabController* controller_; | 48 TabController* controller_; |
48 base::scoped_nsobject<NSTextField> titleView_; | 49 base::scoped_nsobject<NSTextField> titleView_; |
49 GTMFadeTruncatingTextFieldCell* titleViewCell_; // weak | 50 GTMFadeTruncatingTextFieldCell* titleViewCell_; // weak |
50 | 51 |
51 // TODO(rohitrao): Add this button to a CoreAnimation layer so we can fade it | 52 // TODO(rohitrao): Add this button to a CoreAnimation layer so we can fade it |
52 // in and out on mouseovers. | 53 // in and out on mouseovers. |
53 HoverCloseButton* closeButton_; // Weak. | 54 HoverCloseButton* closeButton_; // Weak. |
54 | 55 |
55 BOOL closing_; | 56 BOOL closing_; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 129 |
129 // The TabController |controller_| is not the only owner of this view. If the | 130 // The TabController |controller_| is not the only owner of this view. If the |
130 // controller is released before this view, then we could be hanging onto a | 131 // controller is released before this view, then we could be hanging onto a |
131 // garbage pointer. To prevent this, the TabController uses this interface to | 132 // garbage pointer. To prevent this, the TabController uses this interface to |
132 // clear the |controller_| pointer when it is dying. | 133 // clear the |controller_| pointer when it is dying. |
133 @interface TabView (TabControllerInterface) | 134 @interface TabView (TabControllerInterface) |
134 - (void)setController:(TabController*)controller; | 135 - (void)setController:(TabController*)controller; |
135 @end | 136 @end |
136 | 137 |
137 #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_VIEW_H_ | 138 #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_VIEW_H_ |
OLD | NEW |