diff options
author | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-23 02:13:49 +0000 |
---|---|---|
committer | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-23 02:13:49 +0000 |
commit | 2a87ba2881cf9d572d9914a9cfd35e18fc171a48 (patch) | |
tree | 325cb56704c15f380c293443d0576366a21e1cd7 /chrome/browser/ui/panels/panel.cc | |
parent | be17a59168fe7a2ae859db3d9ccbd5e0f366ad7b (diff) | |
download | chromium_src-2a87ba2881cf9d572d9914a9cfd35e18fc171a48.zip chromium_src-2a87ba2881cf9d572d9914a9cfd35e18fc171a48.tar.gz chromium_src-2a87ba2881cf9d572d9914a9cfd35e18fc171a48.tar.bz2 |
Implement Panel::GetDispositionForPopupBounds(), move shared to browser_navigator.cc (take 2)
+Fixes win_aura build
This CL is mostly cleanup. There are four places where we need to check the size of popups against a window size to determine whether they should become popups or new tabs:
* BrowserView for Aura
* Panel for Aura
* chromeos::BrowserView
* chromeos::PanelBrowserView
All of these cases except BrowserView will become deprecated soon, so browser_navigator (which calls GetDispositionForPopupBounds) seemed like the right place for the shared logic.
BUG=108363
TEST=See issue for test. Only behavioral change should be for Panel windows on Aura opening large windows with window.open().
TBR=ben@chromium.org,prasadt@chromium.org,rsesek
Review URL: http://codereview.chromium.org/8962038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115670 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/panels/panel.cc')
-rw-r--r-- | chrome/browser/ui/panels/panel.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/chrome/browser/ui/panels/panel.cc b/chrome/browser/ui/panels/panel.cc index 321155e..497f79d 100644 --- a/chrome/browser/ui/panels/panel.cc +++ b/chrome/browser/ui/panels/panel.cc @@ -23,6 +23,10 @@ #include "content/public/browser/notification_types.h" #include "ui/gfx/rect.h" +#if defined(USE_AURA) +#include "ui/gfx/screen.h" +#endif + // static const Extension* Panel::GetExtensionFromBrowser(Browser* browser) { // Find the extension. When we create a panel from an extension, the extension @@ -529,8 +533,16 @@ gfx::Rect Panel::GetInstantBounds() { WindowOpenDisposition Panel::GetDispositionForPopupBounds( const gfx::Rect& bounds) { - NOTIMPLEMENTED(); +#if defined(USE_AURA) + // TODO(stevenjb): Remove this platform specific behavior after R18 when + // the panel code has moved to aura_shell. + gfx::Size window_size = gfx::Screen::GetMonitorAreaNearestWindow( + native_panel_->GetNativePanelHandle()).size(); + return browser::DispositionForPopupBounds( + bounds, window_size.width(), window_size.height()); +#else return NEW_POPUP; +#endif } FindBar* Panel::CreateFindBar() { |