| 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_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 } // namespace TabStripControllerInternal | 34 } // namespace TabStripControllerInternal |
| 35 | 35 |
| 36 // The interface for the tab strip controller's delegate. | 36 // The interface for the tab strip controller's delegate. |
| 37 // Delegating TabStripModelObserverBridge's events (in lieu of directly | 37 // Delegating TabStripModelObserverBridge's events (in lieu of directly |
| 38 // subscribing to TabStripModelObserverBridge events, as TabStripController | 38 // subscribing to TabStripModelObserverBridge events, as TabStripController |
| 39 // does) is necessary to guarantee a proper order of subviews layout updates, | 39 // does) is necessary to guarantee a proper order of subviews layout updates, |
| 40 // otherwise it might trigger unnesessary content relayout, UI flickering etc. | 40 // otherwise it might trigger unnesessary content relayout, UI flickering etc. |
| 41 @protocol TabStripControllerDelegate | 41 @protocol TabStripControllerDelegate |
| 42 | 42 |
| 43 // Stripped down version of TabStripModelObserverBridge:selectTabWithContents. | 43 // Stripped down version of TabStripModelObserverBridge:selectTabWithContents. |
| 44 - (void)onSelectTabWithContents:(TabContents*)contents; | 44 - (void)onActivateTabWithContents:(TabContents*)contents; |
| 45 | 45 |
| 46 // Stripped down version of TabStripModelObserverBridge:tabReplacedWithContents. | 46 // Stripped down version of TabStripModelObserverBridge:tabReplacedWithContents. |
| 47 - (void)onReplaceTabWithContents:(TabContents*)contents; | 47 - (void)onReplaceTabWithContents:(TabContents*)contents; |
| 48 | 48 |
| 49 // Stripped down version of TabStripModelObserverBridge:tabChangedWithContents. | 49 // Stripped down version of TabStripModelObserverBridge:tabChangedWithContents. |
| 50 - (void)onSelectedTabChange:(TabStripModelObserver::TabChangeType)change; | 50 - (void)onTabChanged:(TabStripModelObserver::TabChangeType)change |
| 51 withContents:(TabContents*)contents; |
| 51 | 52 |
| 52 // Stripped down version of TabStripModelObserverBridge:tabDetachedWithContents. | 53 // Stripped down version of TabStripModelObserverBridge:tabDetachedWithContents. |
| 53 - (void)onTabDetachedWithContents:(TabContents*)contents; | 54 - (void)onTabDetachedWithContents:(TabContents*)contents; |
| 54 | 55 |
| 55 @end | 56 @end |
| 56 | 57 |
| 57 // A class that handles managing the tab strip in a browser window. It uses | 58 // A class that handles managing the tab strip in a browser window. It uses |
| 58 // a supporting C++ bridge object to register for notifications from the | 59 // a supporting C++ bridge object to register for notifications from the |
| 59 // TabStripModel. The Obj-C part of this class handles drag and drop and all | 60 // TabStripModel. The Obj-C part of this class handles drag and drop and all |
| 60 // the other Cocoa-y aspects. | 61 // the other Cocoa-y aspects. |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // "switched" every time the user switches tabs. The children of this view | 164 // "switched" every time the user switches tabs. The children of this view |
| 164 // will be released, so if you want them to stay around, make sure | 165 // will be released, so if you want them to stay around, make sure |
| 165 // you have retained them. | 166 // you have retained them. |
| 166 // |delegate| is the one listening to filtered TabStripModelObserverBridge's | 167 // |delegate| is the one listening to filtered TabStripModelObserverBridge's |
| 167 // events (see TabStripControllerDelegate for more details). | 168 // events (see TabStripControllerDelegate for more details). |
| 168 - (id)initWithView:(TabStripView*)view | 169 - (id)initWithView:(TabStripView*)view |
| 169 switchView:(NSView*)switchView | 170 switchView:(NSView*)switchView |
| 170 browser:(Browser*)browser | 171 browser:(Browser*)browser |
| 171 delegate:(id<TabStripControllerDelegate>)delegate; | 172 delegate:(id<TabStripControllerDelegate>)delegate; |
| 172 | 173 |
| 173 // Return the view for the currently selected tab. | 174 // Return the view for the currently active tab. |
| 174 - (NSView*)selectedTabView; | 175 - (NSView*)activeTabView; |
| 175 | 176 |
| 176 // Set the frame of the selected tab, also updates the internal frame dict. | 177 // Set the frame of the active tab, also updates the internal frame dict. |
| 177 - (void)setFrameOfSelectedTab:(NSRect)frame; | 178 - (void)setFrameOfActiveTab:(NSRect)frame; |
| 178 | 179 |
| 179 // Move the given tab at index |from| in this window to the location of the | 180 // Move the given tab at index |from| in this window to the location of the |
| 180 // current placeholder. | 181 // current placeholder. |
| 181 - (void)moveTabFromIndex:(NSInteger)from; | 182 - (void)moveTabFromIndex:(NSInteger)from; |
| 182 | 183 |
| 183 // Drop a given TabContents at the location of the current placeholder. If there | 184 // Drop a given TabContents at the location of the current placeholder. If there |
| 184 // is no placeholder, it will go at the end. Used when dragging from another | 185 // is no placeholder, it will go at the end. Used when dragging from another |
| 185 // window when we don't have access to the TabContents as part of our strip. | 186 // window when we don't have access to the TabContents as part of our strip. |
| 186 // |frame| is in the coordinate system of the tab strip view and represents | 187 // |frame| is in the coordinate system of the tab strip view and represents |
| 187 // where the user dropped the new tab so it can be animated into its correct | 188 // where the user dropped the new tab so it can be animated into its correct |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 - (void)attachConstrainedWindow:(ConstrainedWindowMac*)window; | 266 - (void)attachConstrainedWindow:(ConstrainedWindowMac*)window; |
| 266 - (void)removeConstrainedWindow:(ConstrainedWindowMac*)window; | 267 - (void)removeConstrainedWindow:(ConstrainedWindowMac*)window; |
| 267 | 268 |
| 268 @end | 269 @end |
| 269 | 270 |
| 270 // Notification sent when the number of tabs changes. The object will be this | 271 // Notification sent when the number of tabs changes. The object will be this |
| 271 // controller. | 272 // controller. |
| 272 extern NSString* const kTabStripNumberOfTabsChanged; | 273 extern NSString* const kTabStripNumberOfTabsChanged; |
| 273 | 274 |
| 274 #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_CONTROLLER_H_ | 275 #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_CONTROLLER_H_ |
| OLD | NEW |