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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_VIEW_H_
6 #define CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_VIEW_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/mac/scoped_nsobject.h"
11 #import "chrome/browser/ui/cocoa/background_gradient_view.h"
12 #import "chrome/browser/ui/cocoa/url_drop_target.h"
15 @
class TabStripController
;
17 // A view class that handles rendering the tab strip and drops of URLS with
18 // a positioning locator for drop feedback.
20 @interface TabStripView
: BackgroundGradientView
<URLDropTarget
> {
22 TabStripController
* controller_
; // Weak; owns us.
24 NSTimeInterval lastMouseUp_
;
26 // Handles being a drag-and-drop target.
27 base::scoped_nsobject
<URLDropTargetHandler
> dropHandler_
;
29 base::scoped_nsobject
<NewTabButton
> newTabButton_
;
31 // Whether the drop-indicator arrow is shown, and if it is, the coordinate of
34 NSPoint dropArrowPosition_
;
37 @
property(assign
, nonatomic
) BOOL dropArrowShown
;
38 @
property(assign
, nonatomic
) NSPoint dropArrowPosition
;
40 // Name starts with "get" because methods staring with "new" return retained
41 // objects according to Cocoa's create rule.
42 - (NewTabButton
*)getNewTabButton
;
46 // Interface for the controller to set and clear the weak reference to itself.
47 @interface
TabStripView (TabStripControllerInterface
)
48 - (void)setController
:(TabStripController
*)controller
;
51 // Protected methods subclasses can override to alter behavior. Clients should
52 // not call these directly.
53 @interface
TabStripView (Protected
)
54 - (void)drawBottomBorder
:(NSRect
)bounds
;
55 - (BOOL
)doubleClickMinimizesWindow
;
58 @interface
TabStripView (TestingAPI
)
59 - (void)setNewTabButton
:(NewTabButton
*)button
;
62 #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_VIEW_H_