diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-22 10:08:51 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-22 10:08:51 +0000 |
commit | 136affa2d85f7091b9c0a9c3460e032acf41306a (patch) | |
tree | ed5472532d01668caa809c065d5e47b0aa4406fd /chrome/browser/ui/window_sizer/window_sizer.cc | |
parent | 2b157885b419b8acd0bd95d08125b4380f703a68 (diff) | |
download | chromium_src-136affa2d85f7091b9c0a9c3460e032acf41306a.zip chromium_src-136affa2d85f7091b9c0a9c3460e032acf41306a.tar.gz chromium_src-136affa2d85f7091b9c0a9c3460e032acf41306a.tar.bz2 |
[Cleanup]
- remove unnecessary argument from GetBoundsOverrideAsh
- Changed if in DetermineWindowBoundsAndShow() to early exists
- removed GetBoundsOverride. It's easy to follow without it.
- made variables easy to read/understand.
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/11660017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174515 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/window_sizer/window_sizer.cc')
-rw-r--r-- | chrome/browser/ui/window_sizer/window_sizer.cc | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/chrome/browser/ui/window_sizer/window_sizer.cc b/chrome/browser/ui/window_sizer/window_sizer.cc index f966981..851b6f8 100644 --- a/chrome/browser/ui/window_sizer/window_sizer.cc +++ b/chrome/browser/ui/window_sizer/window_sizer.cc @@ -198,16 +198,23 @@ void WindowSizer::DetermineWindowBoundsAndShowState( *show_state = GetWindowDefaultShowState(); *bounds = specified_bounds; if (bounds->IsEmpty()) { - if (GetBoundsOverride(specified_bounds, bounds, show_state)) +#if defined(USE_ASH) + // See if ash should decide the window placement. + // TODO(beng): insufficient but currently necessary. + // http://crbug.com/133312 + if (chrome::ShouldOpenAshOnStartup() && + GetBoundsOverrideAsh(bounds, show_state)) + return; +#endif + // See if there's last active window's placement information. + if (GetLastWindowBounds(bounds, show_state)) return; // See if there's saved placement information. - if (!GetLastWindowBounds(bounds, show_state)) { - if (!GetSavedWindowBounds(bounds, show_state)) { - // No saved placement, figure out some sensible default size based on - // the user's screen size. - GetDefaultWindowBounds(bounds); - } - } + if (GetSavedWindowBounds(bounds, show_state)) + return; + // No saved placement, figure out some sensible default size based on + // the user's screen size. + GetDefaultWindowBounds(bounds); } else { // In case that there was a bound given we need to make sure that it is // visible and fits on the screen. @@ -366,18 +373,6 @@ void WindowSizer::AdjustBoundsToBeVisibleOnMonitorContaining( #endif // defined(OS_MACOSX) } -bool WindowSizer::GetBoundsOverride( - const gfx::Rect& specified_bounds, - gfx::Rect* bounds, - ui::WindowShowState* show_state) const { -#if defined(USE_ASH) - // TODO(beng): insufficient but currently necessary. http://crbug.com/133312 - if (chrome::ShouldOpenAshOnStartup()) - return GetBoundsOverrideAsh(specified_bounds, bounds, show_state); -#endif - return false; -} - ui::WindowShowState WindowSizer::GetWindowDefaultShowState() const { if (!browser_) return ui::SHOW_STATE_DEFAULT; |