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

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

Issue 501135: Revert 34998, more stabbing in the dark to find a perf regression - Mac: impl... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years 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_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 <deque> 10 #include <deque>
11 #include <map> 11 #include <map>
12 12
13 #include "base/scoped_nsobject.h" 13 #include "base/scoped_nsobject.h"
14 #include "base/scoped_ptr.h" 14 #include "base/scoped_ptr.h"
15 #import "chrome/browser/cocoa/tab_controller_target.h" 15 #import "chrome/browser/cocoa/tab_controller_target.h"
16 #import "chrome/browser/cocoa/url_drop_target.h"
17 #import "third_party/GTM/AppKit/GTMWindowSheetController.h" 16 #import "third_party/GTM/AppKit/GTMWindowSheetController.h"
18 17
19 @class TabView; 18 @class TabView;
20 @class TabStripView; 19 @class TabStripView;
21 20
22 class Browser; 21 class Browser;
23 class ConstrainedWindowMac; 22 class ConstrainedWindowMac;
24 class TabStripModelObserverBridge; 23 class TabStripModelObserverBridge;
25 class TabStripModel; 24 class TabStripModel;
26 class TabContents; 25 class TabContents;
27 class ToolbarModel; 26 class ToolbarModel;
28 27
29 // A class that handles managing the tab strip in a browser window. It uses 28 // A class that handles managing the tab strip in a browser window. It uses
30 // a supporting C++ bridge object to register for notifications from the 29 // a supporting C++ bridge object to register for notifications from the
31 // TabStripModel. The Obj-C part of this class handles drag and drop and all 30 // TabStripModel. The Obj-C part of this class handles drag and drop and all
32 // the other Cocoa-y aspects. 31 // the other Cocoa-y aspects.
33 // 32 //
34 // When a new tab is created, we create a TabController which manages loading 33 // When a new tab is created, we create a TabController which manages loading
35 // the contents, including toolbar, from a separate nib file. This controller 34 // the contents, including toolbar, from a separate nib file. This controller
36 // then handles replacing the contentView of the window. As tabs are switched, 35 // then handles replacing the contentView of the window. As tabs are switched,
37 // the single child of the contentView is swapped around to hold the contents 36 // the single child of the contentView is swapped around to hold the contents
38 // (toolbar and all) representing that tab. 37 // (toolbar and all) representing that tab.
39 38
40 @interface TabStripController : 39 @interface TabStripController :
41 NSObject<TabControllerTarget, 40 NSObject<TabControllerTarget,
42 URLDropTargetController,
43 GTMWindowSheetControllerDelegate> { 41 GTMWindowSheetControllerDelegate> {
44 @private 42 @private
45 TabContents* currentTab_; // weak, tab for which we're showing state 43 TabContents* currentTab_; // weak, tab for which we're showing state
46 scoped_nsobject<TabStripView> tabStripView_; 44 scoped_nsobject<TabStripView> tabStripView_;
47 NSView* switchView_; // weak 45 NSView* switchView_; // weak
48 scoped_nsobject<NSView> dragBlockingView_; // avoid bad window server drags 46 scoped_nsobject<NSView> dragBlockingView_; // avoid bad window server drags
49 NSButton* newTabButton_; // weak, obtained from the nib. 47 NSButton* newTabButton_; // weak, obtained from the nib.
50 48
51 // Tracks the newTabButton_ for rollovers. 49 // Tracks the newTabButton_ for rollovers.
52 scoped_nsobject<NSTrackingArea> newTabTrackingArea_; 50 scoped_nsobject<NSTrackingArea> newTabTrackingArea_;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // closure. 170 // closure.
173 - (BOOL)inRapidClosureMode; 171 - (BOOL)inRapidClosureMode;
174 172
175 // Returns YES if the user is allowed to drag tabs on the strip at this moment. 173 // Returns YES if the user is allowed to drag tabs on the strip at this moment.
176 // For example, this returns NO if there are any pending tab close animtations. 174 // For example, this returns NO if there are any pending tab close animtations.
177 - (BOOL)tabDraggingAllowed; 175 - (BOOL)tabDraggingAllowed;
178 176
179 // Default height for tabs. 177 // Default height for tabs.
180 + (CGFloat)defaultTabHeight; 178 + (CGFloat)defaultTabHeight;
181 179
180 // Effectively an implementation of the |URLDropTargetWindowController|
181 // protocol, which the |BrowserWindowController| just reflects to us. This
182 // needed for dropping URLs on the tab strip.
183 - (void)dropURLs:(NSArray*)urls at:(NSPoint)location;
184 - (void)indicateDropURLsAt:(NSPoint)location;
185 - (void)hideDropURLsIndicator;
186
182 // Returns the (lazily created) window sheet controller of this window. Used 187 // Returns the (lazily created) window sheet controller of this window. Used
183 // for the per-tab sheets. 188 // for the per-tab sheets.
184 - (GTMWindowSheetController*)sheetController; 189 - (GTMWindowSheetController*)sheetController;
185 190
186 // See comments in browser_window_controller.h for documentation about these 191 // See comments in browser_window_controller.h for documentation about these
187 // functions. 192 // functions.
188 - (BOOL)attachConstrainedWindow:(ConstrainedWindowMac*)window; 193 - (BOOL)attachConstrainedWindow:(ConstrainedWindowMac*)window;
189 - (void)removeConstrainedWindow:(ConstrainedWindowMac*)window; 194 - (void)removeConstrainedWindow:(ConstrainedWindowMac*)window;
190 195
191 @end 196 @end
192 197
193 // Notification sent when the number of tabs changes. The object will be this 198 // Notification sent when the number of tabs changes. The object will be this
194 // controller. 199 // controller.
195 extern NSString* const kTabStripNumberOfTabsChanged; 200 extern NSString* const kTabStripNumberOfTabsChanged;
196 201
197 #endif // CHROME_BROWSER_COCOA_TAB_STRIP_CONTROLLER_H_ 202 #endif // CHROME_BROWSER_COCOA_TAB_STRIP_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/browser_window_controller.mm ('k') | chrome/browser/cocoa/tab_strip_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698