Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Side by Side Diff: chrome/browser/cocoa/tab_window_controller.h

Issue 102010: Implement dropping of tabs into an existing tab strip from another window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 - (TabWindowController*)detachTabToNewWindow:(TabView*)tabView; 55 - (TabWindowController*)detachTabToNewWindow:(TabView*)tabView;
56 56
57 // Make room in the tab strip for |tab| at the given x coordinate. 57 // Make room in the tab strip for |tab| at the given x coordinate.
58 - (void)insertPlaceholderForTab:(TabView*)tab 58 - (void)insertPlaceholderForTab:(TabView*)tab
59 frame:(NSRect)frame 59 frame:(NSRect)frame
60 yStretchiness:(CGFloat)yStretchiness; 60 yStretchiness:(CGFloat)yStretchiness;
61 61
62 // Removes the placeholder installed by |-insertPlaceholderForTab:atLocation:|. 62 // Removes the placeholder installed by |-insertPlaceholderForTab:atLocation:|.
63 - (void)removePlaceholder; 63 - (void)removePlaceholder;
64 64
65 // Drop a given tab view at the location of the current placeholder. If there
66 // is no placeholder, it will go at the end. |controller| is the window
67 // controller of a tab being dropped from a different window. It will be nil
68 // if the drag is within the window. The implementation will call
69 // |-removePlaceholder| since the drag is now complete. This also calls
70 // |-layoutTabs| internally so clients do not need to call it again. When
71 // dragging tabs between windows, this should be called *before*
72 // |-detachTabView| on the source window since it needs to still be in the
73 // source window's tab model for this method to find the information it needs
74 // to complete the drop.
75 - (void)dropTabView:(NSView*)view
76 fromController:(TabWindowController*)controller;
77
78 // Tells the tab strip to forget about this tab in preparation for it being
79 // put into a different tab strip, such as during a drop on another window.
80 - (void)detachTabView:(NSView*)view;
81
65 // Number of tabs in the tab strip. Useful, for example, to know if we're 82 // Number of tabs in the tab strip. Useful, for example, to know if we're
66 // dragging the only tab in the window. 83 // dragging the only tab in the window.
67 - (NSInteger)numberOfTabs; 84 - (NSInteger)numberOfTabs;
68 85
69 // Return the view of the selected tab. 86 // Return the view of the selected tab.
70 - (NSView *)selectedTabView; 87 - (NSView *)selectedTabView;
71 88
72 // Drop a given tab view at a new index.
73 - (void)dropTabView:(NSView *)view atIndex:(NSUInteger)index;
74
75 // The title of the selected tab. 89 // The title of the selected tab.
76 - (NSString*)selectedTabTitle; 90 - (NSString*)selectedTabTitle;
77 91
78 @end 92 @end
79 93
80 @interface TabWindowController(ProtectedMethods) 94 @interface TabWindowController(ProtectedMethods)
81 // A list of all the views that need to move to the overlay window. Subclasses 95 // A list of all the views that need to move to the overlay window. Subclasses
82 // can override this to add more things besides the tab strip. Be sure to 96 // can override this to add more things besides the tab strip. Be sure to
83 // call the superclass' version if overridden. 97 // call the superclass' version if overridden.
84 - (NSArray*)viewsToMoveToOverlay; 98 - (NSArray*)viewsToMoveToOverlay;
85 @end 99 @end
86 100
87 #endif // CHROME_BROWSER_TAB_WINDOW_CONTROLLER_H_ 101 #endif // CHROME_BROWSER_TAB_WINDOW_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698