Index: chrome/browser/ui/window_sizer/window_sizer_ash.cc |
diff --git a/chrome/browser/ui/window_sizer/window_sizer_ash.cc b/chrome/browser/ui/window_sizer/window_sizer_ash.cc |
index 7c6da18dafa611c79b7e1971c5f3e2fc83af22e0..38b00978cb9c84a494b6e3540ec4df5e55b0164a 100644 |
--- a/chrome/browser/ui/window_sizer/window_sizer_ash.cc |
+++ b/chrome/browser/ui/window_sizer/window_sizer_ash.cc |
@@ -15,10 +15,6 @@ |
bool WindowSizer::GetBrowserBoundsAsh(gfx::Rect* bounds, |
ui::WindowShowState* show_state) const { |
- if (!browser_ || |
- browser_->host_desktop_type() != chrome::HOST_DESKTOP_TYPE_ASH) |
- return false; |
- |
if (bounds->IsEmpty()) { |
if (browser_->is_type_tabbed()) { |
GetTabbedBrowserBoundsAsh(bounds, show_state); |
@@ -55,6 +51,32 @@ bool WindowSizer::GetBrowserBoundsAsh(gfx::Rect* bounds, |
return false; |
} |
+bool WindowSizer::GetBrowserBoundsAshAdjusted( |
msw
2014/08/05 01:42:58
Merge this into GetBrowserBoundsAsh. Its one call
varkha
2014/08/05 15:00:20
Done. Was considering doing that but wanted to see
|
+ gfx::Rect* bounds, |
+ ui::WindowShowState* show_state) const { |
+ if (!browser_ || |
+ browser_->host_desktop_type() != chrome::HOST_DESKTOP_TYPE_ASH) |
+ return false; |
+ |
+ bool determined = GetBrowserBoundsAsh(bounds, show_state); |
+ |
+ if (*show_state == ui::SHOW_STATE_DEFAULT) { |
+ gfx::Display display = screen_->GetDisplayMatching(*bounds); |
+ gfx::Rect work_area = display.work_area(); |
+ bounds->AdjustToFit(work_area); |
+ if (*bounds == work_area) { |
+ // A window that occupies the whole work area gets maximized. |
+ // |window_bounds| returned here become the restore bounds once the window |
msw
2014/08/05 01:42:58
nit: s/|window_bounds|/|bounds|/ to match the actu
varkha
2014/08/05 15:00:20
Done.
|
+ // gets maximized after this method returns. Return a sensible default |
+ // in order to make restored state visibly different from maximized. |
+ *show_state = ui::SHOW_STATE_MAXIMIZED; |
+ *bounds = ash::WindowPositioner::GetDefaultWindowBounds(display); |
+ determined = true; |
+ } |
+ } |
+ return determined; |
+} |
+ |
void WindowSizer::GetTabbedBrowserBoundsAsh( |
gfx::Rect* bounds_in_screen, |
ui::WindowShowState* show_state) const { |