tab_strip_view.h revision eb525c5499e34cc9c4b825d6d9e75bb07cc06ace
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. 4 5#ifndef CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_VIEW_H_ 6#define CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_VIEW_H_ 7 8#import <Cocoa/Cocoa.h> 9 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" 13 14@class NewTabButton; 15@class TabStripController; 16 17// A view class that handles rendering the tab strip and drops of URLS with 18// a positioning locator for drop feedback. 19 20@interface TabStripView : BackgroundGradientView<URLDropTarget> { 21 @private 22 TabStripController* controller_; // Weak; owns us. 23 24 NSTimeInterval lastMouseUp_; 25 26 // Handles being a drag-and-drop target. 27 base::scoped_nsobject<URLDropTargetHandler> dropHandler_; 28 29 base::scoped_nsobject<NewTabButton> newTabButton_; 30 31 // Whether the drop-indicator arrow is shown, and if it is, the coordinate of 32 // its tip. 33 BOOL dropArrowShown_; 34 NSPoint dropArrowPosition_; 35} 36 37@property(assign, nonatomic) BOOL dropArrowShown; 38@property(assign, nonatomic) NSPoint dropArrowPosition; 39 40// Name starts with "get" because methods staring with "new" return retained 41// objects according to Cocoa's create rule. 42- (NewTabButton*)getNewTabButton; 43 44@end 45 46// Interface for the controller to set and clear the weak reference to itself. 47@interface TabStripView (TabStripControllerInterface) 48- (void)setController:(TabStripController*)controller; 49@end 50 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; 56@end 57 58@interface TabStripView (TestingAPI) 59- (void)setNewTabButton:(NewTabButton*)button; 60@end 61 62#endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_VIEW_H_ 63