| Index: chrome/browser/chromeos/frame/browser_view.cc
|
| diff --git a/chrome/browser/chromeos/frame/browser_view.cc b/chrome/browser/chromeos/frame/browser_view.cc
|
| index 8d02d6bd5eba51f12a5fd870d60200bce22834a6..5d9a449017157493d9419020d9de56774fc84edc 100644
|
| --- a/chrome/browser/chromeos/frame/browser_view.cc
|
| +++ b/chrome/browser/chromeos/frame/browser_view.cc
|
| @@ -42,6 +42,9 @@ namespace {
|
|
|
| // Amount to offset the toolbar by when vertical tabs are enabled.
|
| const int kVerticalTabStripToolbarOffset = 2;
|
| +// If a popup window is larger than this fraction of the screen, create a tab.
|
| +const float kPopupMaxWidthFactor = 0.5;
|
| +const float kPopupMaxHeightFactor = 0.6;
|
|
|
| } // namespace
|
|
|
| @@ -315,6 +318,23 @@ void BrowserView::Paste() {
|
| gtk_util::DoPaste(this);
|
| }
|
|
|
| +void BrowserView::AdjustNavigateParams(browser::NavigateParams* params) {
|
| + if (params->disposition == NEW_POPUP) {
|
| + // If the popup is larger than a given fraction of the screen, turn it into
|
| + // a foreground tab. Also check for width or height == 0, which indicate
|
| + // a tab sized popup window.
|
| + GdkScreen* screen = gdk_screen_get_default();
|
| + int max_width = gdk_screen_get_width(screen) * kPopupMaxWidthFactor;
|
| + int max_height = gdk_screen_get_height(screen) * kPopupMaxHeightFactor;
|
| + if (params->window_bounds.width() > max_width ||
|
| + params->window_bounds.width() == 0 ||
|
| + params->window_bounds.height() > max_height ||
|
| + params->window_bounds.height() == 0) {
|
| + params->disposition = NEW_FOREGROUND_TAB;
|
| + }
|
| + }
|
| +}
|
| +
|
| // views::ContextMenuController overrides.
|
| void BrowserView::ShowContextMenuForView(views::View* source,
|
| const gfx::Point& p,
|
|
|