| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_TAB_WINDOW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_TAB_WINDOW_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_TAB_WINDOW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_TAB_WINDOW_CONTROLLER_H_ |
| 7 | 7 |
| 8 // A class acting as the Objective-C window controller for a window that has | 8 // A class acting as the Objective-C window controller for a window that has |
| 9 // tabs which can be dragged around. Tabs can be re-arranged within the same | 9 // tabs which can be dragged around. Tabs can be re-arranged within the same |
| 10 // window or dragged into other TabWindowController windows. This class doesn't | 10 // window or dragged into other TabWindowController windows. This class doesn't |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // no placeholder, it will go at the end. |controller| is the window controller | 101 // no placeholder, it will go at the end. |controller| is the window controller |
| 102 // of a tab being dropped from a different window. It will be nil if the drag is | 102 // of a tab being dropped from a different window. It will be nil if the drag is |
| 103 // within the window, otherwise the tab is removed from that window before being | 103 // within the window, otherwise the tab is removed from that window before being |
| 104 // placed into this one. The implementation will call |-removePlaceholder| since | 104 // placed into this one. The implementation will call |-removePlaceholder| since |
| 105 // the drag is now complete. This also calls |-layoutTabs| internally so | 105 // the drag is now complete. This also calls |-layoutTabs| internally so |
| 106 // clients do not need to call it again. | 106 // clients do not need to call it again. |
| 107 - (void)moveTabView:(NSView*)view | 107 - (void)moveTabView:(NSView*)view |
| 108 fromController:(TabWindowController*)controller; | 108 fromController:(TabWindowController*)controller; |
| 109 | 109 |
| 110 // Number of tabs in the tab strip. Useful, for example, to know if we're | 110 // Number of tabs in the tab strip. Useful, for example, to know if we're |
| 111 // dragging the only tab in the window. | 111 // dragging the only tab in the window. This includes pinned tabs (both live |
| 112 // and not). |
| 112 - (NSInteger)numberOfTabs; | 113 - (NSInteger)numberOfTabs; |
| 113 | 114 |
| 115 // YES if there are tabs in the tab strip which have content, allowing for |
| 116 // the notion of tabs in the tab strip that are placeholders, or phantoms, but |
| 117 // currently have no content. |
| 118 - (BOOL)hasLiveTabs; |
| 119 |
| 114 // Return the view of the selected tab. | 120 // Return the view of the selected tab. |
| 115 - (NSView *)selectedTabView; | 121 - (NSView *)selectedTabView; |
| 116 | 122 |
| 117 // The title of the selected tab. | 123 // The title of the selected tab. |
| 118 - (NSString*)selectedTabTitle; | 124 - (NSString*)selectedTabTitle; |
| 119 | 125 |
| 120 // Called to check whether or not this controller's window has a tab strip (YES | 126 // Called to check whether or not this controller's window has a tab strip (YES |
| 121 // if it does, NO otherwise). The default implementation returns YES. | 127 // if it does, NO otherwise). The default implementation returns YES. |
| 122 - (BOOL)hasTabStrip; | 128 - (BOOL)hasTabStrip; |
| 123 | 129 |
| 124 // Get/set whether a particular tab is draggable between windows. | 130 // Get/set whether a particular tab is draggable between windows. |
| 125 - (BOOL)isTabDraggable:(NSView*)tabView; | 131 - (BOOL)isTabDraggable:(NSView*)tabView; |
| 126 - (void)setTab:(NSView*)tabView isDraggable:(BOOL)draggable; | 132 - (void)setTab:(NSView*)tabView isDraggable:(BOOL)draggable; |
| 127 | 133 |
| 128 // Tell the window that it needs to call performClose: as soon as the current | 134 // Tell the window that it needs to call performClose: as soon as the current |
| 129 // drag is complete. This prevents a window (and its overlay) from going away | 135 // drag is complete. This prevents a window (and its overlay) from going away |
| 130 // during a drag. | 136 // during a drag. |
| 131 - (void)deferPerformClose; | 137 - (void)deferPerformClose; |
| 132 | 138 |
| 133 @end | 139 @end |
| 134 | 140 |
| 135 @interface TabWindowController(ProtectedMethods) | 141 @interface TabWindowController(ProtectedMethods) |
| 136 // Tells the tab strip to forget about this tab in preparation for it being | 142 // Tells the tab strip to forget about this tab in preparation for it being |
| 137 // put into a different tab strip, such as during a drop on another window. | 143 // put into a different tab strip, such as during a drop on another window. |
| 138 - (void)detachTabView:(NSView*)view; | 144 - (void)detachTabView:(NSView*)view; |
| 139 @end | 145 @end |
| 140 | 146 |
| 141 #endif // CHROME_BROWSER_TAB_WINDOW_CONTROLLER_H_ | 147 #endif // CHROME_BROWSER_TAB_WINDOW_CONTROLLER_H_ |
| OLD | NEW |