Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6641)

Unified Diff: chrome/browser/ui/window_sizer/window_sizer_ash.cc

Issue 424463002: Makes a window that has been resized to maximized bounds, then maximized and then restored shrink (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Maximizes a window that has been resized to maximized bounds (comments and restrict to ash) Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 {

Powered by Google App Engine
This is Rietveld 408576698