summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/tab_window_controller.mm
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-02 20:32:54 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-02 20:32:54 +0000
commitc33ab08d62663fff70526b1a3d5b2a57c487ac06 (patch)
treeeef8c1f53ea6d8e906e910ff03ef13bb56ebeb91 /chrome/browser/cocoa/tab_window_controller.mm
parentdbd43729289b80832900af7338fa3d351d81499d (diff)
downloadchromium_src-c33ab08d62663fff70526b1a3d5b2a57c487ac06.zip
chromium_src-c33ab08d62663fff70526b1a3d5b2a57c487ac06.tar.gz
chromium_src-c33ab08d62663fff70526b1a3d5b2a57c487ac06.tar.bz2
Pop-up chrome.
BUG=http://crbug.com/15727 TEST=Load a web page that has a popup. Example: <!DOCTYPE html> Click button to open a new window. <br> <button onclick="w = window.open('http://www.google.com', 'New Window', 'width=512,height=512'); w.moveTo(300,300);">Open with w,h</button> Now click on the button to get a pop-up. In the new window, make sure there is no "tab" area above the URL bar, and no "new tab" button. Hit Cmd-T to create a new tab, and make sure it gets created in the OTHER window. More work is needed to minimize pop-up chrome more, but this'll prevent the most brutal failures (e.g. team meeting "demo" today). Review URL: http://codereview.chromium.org/151135 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19837 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/tab_window_controller.mm')
-rw-r--r--chrome/browser/cocoa/tab_window_controller.mm24
1 files changed, 18 insertions, 6 deletions
diff --git a/chrome/browser/cocoa/tab_window_controller.mm b/chrome/browser/cocoa/tab_window_controller.mm
index 12fc4a5..41d0b78 100644
--- a/chrome/browser/cocoa/tab_window_controller.mm
+++ b/chrome/browser/cocoa/tab_window_controller.mm
@@ -16,12 +16,18 @@
@synthesize tabContentArea = tabContentArea_;
- (void)windowDidLoad {
- // Place the tab bar above the content box and add it to the view hierarchy
- // as a sibling of the content view so it can overlap with the window frame.
- NSRect tabFrame = [tabContentArea_ frame];
- tabFrame.origin = NSMakePoint(0, NSMaxY(tabFrame));
- tabFrame.size.height = NSHeight([tabStripView_ frame]);
- [tabStripView_ setFrame:tabFrame];
+ // TODO(jrg): a non-normal window (e.g. for pop-ups) needs more work
+ // than just removal of the tab strip offset. But this is enough to
+ // avoid confusion (e.g. "new tab" on popup gets created in a
+ // different window).
+ if ([self isNormalWindow]) {
+ // Place the tab bar above the content box and add it to the view hierarchy
+ // as a sibling of the content view so it can overlap with the window frame.
+ NSRect tabFrame = [tabContentArea_ frame];
+ tabFrame.origin = NSMakePoint(0, NSMaxY(tabFrame));
+ tabFrame.size.height = NSHeight([tabStripView_ frame]);
+ [tabStripView_ setFrame:tabFrame];
+ }
[[[[self window] contentView] superview] addSubview:tabStripView_];
}
@@ -156,4 +162,10 @@
return @"";
}
+- (BOOL)isNormalWindow {
+ // subclass must implement
+ NOTIMPLEMENTED();
+ return YES;
+}
+
@end