OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_COCOA_TAB_STRIP_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_COCOA_TAB_STRIP_CONTROLLER_H_ |
6 #define CHROME_BROWSER_COCOA_TAB_STRIP_CONTROLLER_H_ | 6 #define CHROME_BROWSER_COCOA_TAB_STRIP_CONTROLLER_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/scoped_nsobject.h" | 10 #include "base/scoped_nsobject.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // an array of TabControllers which manage the actual tab views. As above, | 47 // an array of TabControllers which manage the actual tab views. As above, |
48 // this is kept in the same order as the tab strip model. | 48 // this is kept in the same order as the tab strip model. |
49 scoped_nsobject<NSMutableArray> tabArray_; | 49 scoped_nsobject<NSMutableArray> tabArray_; |
50 | 50 |
51 // These values are only used during a drag, and override tab positioning. | 51 // These values are only used during a drag, and override tab positioning. |
52 TabView* placeholderTab_; // weak. Tab being dragged | 52 TabView* placeholderTab_; // weak. Tab being dragged |
53 NSRect placeholderFrame_; // Frame to use | 53 NSRect placeholderFrame_; // Frame to use |
54 CGFloat placeholderStretchiness_; // Vertical force shown by streching tab. | 54 CGFloat placeholderStretchiness_; // Vertical force shown by streching tab. |
55 // Frame targets for all the current views. | 55 // Frame targets for all the current views. |
56 // target frames are used because repeated requests to [NSView animator]. | 56 // target frames are used because repeated requests to [NSView animator]. |
57 // aren't coalesced, so we store frames to avoid redundant calls. | 57 // aren't coalesced, so we store frames to avoid redundant calls. |
58 scoped_nsobject<NSMutableDictionary> targetFrames_; | 58 scoped_nsobject<NSMutableDictionary> targetFrames_; |
59 NSRect newTabTargetFrame_; | 59 NSRect newTabTargetFrame_; |
60 } | 60 } |
61 | 61 |
62 // Initialize the controller with a view and browser that contains | 62 // Initialize the controller with a view and browser that contains |
63 // everything else we'll need. |switchView| is the view whose contents get | 63 // everything else we'll need. |switchView| is the view whose contents get |
64 // "switched" every time the user switches tabs. The children of this view | 64 // "switched" every time the user switches tabs. The children of this view |
65 // will be released, so if you want them to stay around, make sure | 65 // will be released, so if you want them to stay around, make sure |
66 // you have retained them. | 66 // you have retained them. |
67 - (id)initWithView:(TabStripView*)view | 67 - (id)initWithView:(TabStripView*)view |
68 switchView:(NSView*)switchView | 68 switchView:(NSView*)switchView |
69 model:(TabStripModel*)model; | 69 model:(TabStripModel*)model; |
70 | 70 |
71 // Return the rect, in WebKit coordinates (flipped), of the window's grow box | |
72 // in the coordinate system of the content area of the currently selected tab. | |
73 - (NSRect)selectedTabGrowBoxRect; | |
74 | |
75 // Return the view for the currently selected tab. | 71 // Return the view for the currently selected tab. |
76 - (NSView *)selectedTabView; | 72 - (NSView *)selectedTabView; |
77 | 73 |
78 // Set the frame of the selected tab, also updates the internal frame dict. | 74 // Set the frame of the selected tab, also updates the internal frame dict. |
79 - (void)setFrameOfSelectedTab:(NSRect)frame; | 75 - (void)setFrameOfSelectedTab:(NSRect)frame; |
80 | 76 |
81 // Move the given tab at index |from| in this window to the location of the | 77 // Move the given tab at index |from| in this window to the location of the |
82 // current placeholder. | 78 // current placeholder. |
83 - (void)moveTabFromIndex:(NSInteger)from; | 79 - (void)moveTabFromIndex:(NSInteger)from; |
84 | 80 |
(...skipping 19 matching lines...) Expand all Loading... |
104 | 100 |
105 // Default height for tabs. | 101 // Default height for tabs. |
106 + (CGFloat)defaultTabHeight; | 102 + (CGFloat)defaultTabHeight; |
107 @end | 103 @end |
108 | 104 |
109 // Notification sent when the number of tabs changes. The object will be this | 105 // Notification sent when the number of tabs changes. The object will be this |
110 // controller. | 106 // controller. |
111 extern NSString* const kTabStripNumberOfTabsChanged; | 107 extern NSString* const kTabStripNumberOfTabsChanged; |
112 | 108 |
113 #endif // CHROME_BROWSER_COCOA_TAB_STRIP_CONTROLLER_H_ | 109 #endif // CHROME_BROWSER_COCOA_TAB_STRIP_CONTROLLER_H_ |
OLD | NEW |