diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-11 22:03:17 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-11 22:03:17 +0000 |
commit | a9e8afc41dd0adfe4ac5900f2b73ff259276e2bd (patch) | |
tree | 7c82250d47888a4057e3048bfc7f54c07027fdb2 /chrome/browser/cocoa/tab_strip_controller.h | |
parent | e819b55cf062822a23280b4da7760abfd2a86e64 (diff) | |
download | chromium_src-a9e8afc41dd0adfe4ac5900f2b73ff259276e2bd.zip chromium_src-a9e8afc41dd0adfe4ac5900f2b73ff259276e2bd.tar.gz chromium_src-a9e8afc41dd0adfe4ac5900f2b73ff259276e2bd.tar.bz2 |
Add support for constrained windows on os x, based on Avi's GTMWindowSheetController. Add carpet bombing dialog as first per-tab sheet.
Depends http://codereview.appspot.com/105064 .
The main issue with this patch is that GTMWindowSheetController doesn't provide an api to move sheets between windows, so this CL disables tab dragging for tabs with sheets, and fullscreen mode for windows with sheets. We can fix this later.
Other stuff that should be done at some point, but not now:
* Open/Save panels should be per-tab
* Need an ui test that goes to page, then page with sheet, then hit back, forward, reload.
* Bookmark sheets should not be sheets but in a separate window
BUG=14666
TEST=Go to skypher.com/SkyLined/Repro/Chrome/carpet bombing/repro.html , a per-window sheet should appear. Things to test with this dialog:
* Hitting cmd-q while a sheet is open in any tab should not quit but instead focus the sheet.
* Hitting cmd-w while a sheet is open in any tab should not close the window but instead focus the sheet.
* Dragging a tab with a sheet should move the window (and keep the tab visible), not detach the tab.
* Going fullscreen should be disabled for windows with open tabs.
* When a per-tab sheet is open in a non-active tab, it shouldn't steal the focus, i.e. going to the page above, then hitting cmd-t, and then hitting cmd-l should work.
* Closing a non-frontmost tab with a per-tab sheet shouldn't crash.
* Going to the url above and quickly opening a new tab, so that the sheet opens while its tab is not front-most should work (sheet should display only when you switch back to the tab with the sheet).
* Go to google.com, then to skypher.com/SkyLined/Repro/Chrome/carpet bombing/repro.html ,
hit "backward" with open sheet, hit forward, focus location bar, hit enter. This shouldn't crash.
* Hitting escape should dismiss the sheet
* Hitting enter should confirm the sheet.
Review URL: http://codereview.chromium.org/159780
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23091 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/tab_strip_controller.h')
-rw-r--r-- | chrome/browser/cocoa/tab_strip_controller.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/chrome/browser/cocoa/tab_strip_controller.h b/chrome/browser/cocoa/tab_strip_controller.h index ead599e..06db772 100644 --- a/chrome/browser/cocoa/tab_strip_controller.h +++ b/chrome/browser/cocoa/tab_strip_controller.h @@ -10,11 +10,13 @@ #include "base/scoped_nsobject.h" #include "base/scoped_ptr.h" #import "chrome/browser/cocoa/tab_controller_target.h" +#import "third_party/GTM/AppKit/GTMWindowSheetController.h" @class TabView; @class TabStripView; class Browser; +class ConstrainedWindowMac; class TabStripModelObserverBridge; class TabStripModel; class TabContents; @@ -31,7 +33,9 @@ class ToolbarModel; // the single child of the contentView is swapped around to hold the contents // (toolbar and all) representing that tab. -@interface TabStripController : NSObject <TabControllerTarget> { +@interface TabStripController : + NSObject<TabControllerTarget, + GTMWindowSheetControllerDelegate> { @private TabContents* currentTab_; // weak, tab for which we're showing state TabStripView* tabView_; // weak @@ -77,6 +81,9 @@ class ToolbarModel; // Array of subviews which are permanent (and which should never be removed), // such as the new-tab button, but *not* the tabs themselves. scoped_nsobject<NSMutableArray> permanentSubviews_; + + // Manages per-tab sheets. + scoped_nsobject<GTMWindowSheetController> sheetController_; } // Initialize the controller with a view and browser that contains @@ -127,6 +134,14 @@ class ToolbarModel; // Default height for tabs. + (CGFloat)defaultTabHeight; + +// Returns the (lazily created) window sheet controller of this window. Used +// for the per-tab sheets. +- (GTMWindowSheetController*)sheetController; + +- (void)attachConstrainedWindow:(ConstrainedWindowMac*)window; +- (void)removeConstrainedWindow:(ConstrainedWindowMac*)window; + @end // Notification sent when the number of tabs changes. The object will be this |