summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 16:56:11 +0000
committerstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 16:56:11 +0000
commit8323b08e4aa0138076fa06589706231470c3cee6 (patch)
tree1b1e22c3cd5763daee3978d2cd485f2807a33111 /chrome
parent31f841ec4f20b9421d001cf790f623d1481489c9 (diff)
downloadchromium_src-8323b08e4aa0138076fa06589706231470c3cee6.zip
chromium_src-8323b08e4aa0138076fa06589706231470c3cee6.tar.gz
chromium_src-8323b08e4aa0138076fa06589706231470c3cee6.tar.bz2
Fix for Issue 4211: window.open(,, 'type=FullWindow,fullscreen') should not open full screen page.
In chromeos create a foreground tab if the width or height is 0 (instead of a tab sized popup) http://code.google.com/p/chromium-os/issues/detail?id=4211 BUG=chromeos:4211 TEST=If a third argument is provided to window.open() and either width or height is unspecified, a new tab should be opened instead of a full screen popup. Review URL: http://codereview.chromium.org/2947009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52687 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 66306ae..fb62732 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -903,11 +903,13 @@ void TabContents::AddNewContents(TabContents* new_contents,
if (disposition == NEW_POPUP) {
// If the popup is bigger than a given factor of the screen, then
// turn it into a foreground tab (on chrome os only)
+ // Also check for width or height == 0, which would otherwise indicate
+ // a tab sized popup window.
GdkScreen* screen = gdk_screen_get_default();
int max_width = gdk_screen_get_width(screen) * kMaxWidthFactor;
int max_height = gdk_screen_get_height(screen) * kMaxHeightFactor;
- if (initial_pos.width() > max_width ||
- initial_pos.height() > max_height) {
+ if (initial_pos.width() > max_width || initial_pos.width() == 0 ||
+ initial_pos.height() > max_height || initial_pos.height() == 0) {
disposition = NEW_FOREGROUND_TAB;
}
}