| 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_STRIP_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_VIEW_H_ | 6 #define CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_VIEW_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| 11 #import "chrome/browser/ui/cocoa/background_gradient_view.h" | 11 #import "chrome/browser/ui/cocoa/background_gradient_view.h" |
| 12 #import "chrome/browser/ui/cocoa/url_drop_target.h" | 12 #import "chrome/browser/ui/cocoa/url_drop_target.h" |
| 13 | 13 |
| 14 @class NewTabButton; | 14 @class NewTabButton; |
| 15 @class TabStripController; | 15 @class TabStripController; |
| 16 | 16 |
| 17 // A view class that handles rendering the tab strip and drops of URLS with | 17 // A view class that handles rendering the tab strip and drops of URLS with |
| 18 // a positioning locator for drop feedback. | 18 // a positioning locator for drop feedback. |
| 19 | 19 |
| 20 @interface TabStripView : BackgroundGradientView<URLDropTarget> { | 20 @interface TabStripView : BackgroundGradientView<URLDropTarget> { |
| 21 @private | 21 @private |
| 22 TabStripController* controller_; // Weak; owns us. | |
| 23 | |
| 24 NSTimeInterval lastMouseUp_; | 22 NSTimeInterval lastMouseUp_; |
| 25 | 23 |
| 26 // Handles being a drag-and-drop target. | 24 // Handles being a drag-and-drop target. |
| 27 base::scoped_nsobject<URLDropTargetHandler> dropHandler_; | 25 base::scoped_nsobject<URLDropTargetHandler> dropHandler_; |
| 28 | 26 |
| 29 base::scoped_nsobject<NewTabButton> newTabButton_; | 27 base::scoped_nsobject<NewTabButton> newTabButton_; |
| 30 | 28 |
| 31 // Whether the drop-indicator arrow is shown, and if it is, the coordinate of | 29 // Whether the drop-indicator arrow is shown, and if it is, the coordinate of |
| 32 // its tip. | 30 // its tip. |
| 33 BOOL dropArrowShown_; | 31 BOOL dropArrowShown_; |
| 34 NSPoint dropArrowPosition_; | 32 NSPoint dropArrowPosition_; |
| 35 BOOL inATabDraggingOverlayWindow_; | |
| 36 BOOL visualEffectsDisabledForFullscreen_; | |
| 37 } | 33 } |
| 38 | 34 |
| 35 @property(assign, nonatomic) TabStripController* controller; |
| 39 @property(assign, nonatomic) BOOL dropArrowShown; | 36 @property(assign, nonatomic) BOOL dropArrowShown; |
| 40 @property(assign, nonatomic) NSPoint dropArrowPosition; | 37 @property(assign, nonatomic) NSPoint dropArrowPosition; |
| 41 @property(assign, nonatomic) BOOL inATabDraggingOverlayWindow; | |
| 42 | 38 |
| 43 // Name starts with "get" because methods staring with "new" return retained | 39 // Name starts with "get" because methods staring with "new" return retained |
| 44 // objects according to Cocoa's create rule. | 40 // objects according to Cocoa's create rule. |
| 45 - (NewTabButton*)getNewTabButton; | 41 - (NewTabButton*)getNewTabButton; |
| 46 | |
| 47 // Leaving visual effects enabled when fullscreen results in higher power | |
| 48 // consumption. This is used to disable effects when fullscreen. | |
| 49 - (void)setVisualEffectsDisabledForFullscreen:(BOOL)fullscreen; | |
| 50 @end | |
| 51 | |
| 52 // Interface for the controller to set and clear the weak reference to itself. | |
| 53 @interface TabStripView (TabStripControllerInterface) | |
| 54 - (void)setController:(TabStripController*)controller; | |
| 55 @end | 42 @end |
| 56 | 43 |
| 57 // Protected methods subclasses can override to alter behavior. Clients should | 44 // Protected methods subclasses can override to alter behavior. Clients should |
| 58 // not call these directly. | 45 // not call these directly. |
| 59 @interface TabStripView (Protected) | 46 @interface TabStripView (Protected) |
| 60 - (void)drawBottomBorder:(NSRect)bounds; | 47 - (void)drawBottomBorder:(NSRect)bounds; |
| 61 - (BOOL)doubleClickMinimizesWindow; | 48 - (BOOL)doubleClickMinimizesWindow; |
| 62 @end | 49 @end |
| 63 | 50 |
| 64 @interface TabStripView (TestingAPI) | 51 @interface TabStripView (TestingAPI) |
| 65 - (void)setNewTabButton:(NewTabButton*)button; | 52 - (void)setNewTabButton:(NewTabButton*)button; |
| 66 @end | 53 @end |
| 67 | 54 |
| 68 #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_VIEW_H_ | 55 #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_VIEW_H_ |
| OLD | NEW |