X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fash%2Fwm%2Fwindow_util.cc;h=dc71c58fc2c9736d316cbc292f5f134b13e707f5;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=e6907384ccc762adbe3cf7aac2d17e090531bb10;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/ash/wm/window_util.cc b/src/ash/wm/window_util.cc index e690738..dc71c58 100644 --- a/src/ash/wm/window_util.cc +++ b/src/ash/wm/window_util.cc @@ -18,6 +18,7 @@ #include "ui/gfx/display.h" #include "ui/gfx/rect.h" #include "ui/gfx/screen.h" +#include "ui/gfx/size.h" #include "ui/views/corewm/window_util.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" @@ -52,8 +53,7 @@ bool CanActivateWindow(aura::Window* window) { } bool IsWindowMinimized(aura::Window* window) { - return window->GetProperty(aura::client::kShowStateKey) == - ui::SHOW_STATE_MINIMIZED; + return ash::wm::GetWindowState(window)->IsMinimized(); } void CenterWindow(aura::Window* window) { @@ -78,6 +78,11 @@ void CenterWindow(aura::Window* window) { } } +void AdjustBoundsSmallerThan(const gfx::Size& max_size, gfx::Rect* bounds) { + bounds->set_width(std::min(bounds->width(), max_size.width())); + bounds->set_height(std::min(bounds->height(), max_size.height())); +} + void AdjustBoundsToEnsureMinimumWindowVisibility(const gfx::Rect& visible_area, gfx::Rect* bounds) { AdjustBoundsToEnsureWindowVisibility( @@ -88,8 +93,7 @@ void AdjustBoundsToEnsureWindowVisibility(const gfx::Rect& visible_area, int min_width, int min_height, gfx::Rect* bounds) { - bounds->set_width(std::min(bounds->width(), visible_area.width())); - bounds->set_height(std::min(bounds->height(), visible_area.height())); + AdjustBoundsSmallerThan(visible_area.size(), bounds); min_width = std::min(min_width, visible_area.width()); min_height = std::min(min_height, visible_area.height());