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

Unified Diff: ash/wm/window_util.cc

Issue 1900443002: Removes aura dependencies from WindowPositioner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nuke GetWorkAreaForWindowInParent and fix windows Created 4 years, 8 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
« no previous file with comments | « ash/wm/window_util.h ('k') | ash/wm/window_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_util.cc
diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc
index 7a29d24aba4b9043279ab237d820e6e3d5819deb..f888f79fb60e516b22e8cd85b04882707ac589c0 100644
--- a/ash/wm/window_util.cc
+++ b/ash/wm/window_util.cc
@@ -125,40 +125,6 @@ gfx::Rect GetDefaultRightSnappedWindowBoundsInParent(aura::Window* window) {
work_area_in_parent.height());
}
-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(
- visible_area, kMinimumOnScreenArea, kMinimumOnScreenArea, bounds);
-}
-
-void AdjustBoundsToEnsureWindowVisibility(const gfx::Rect& visible_area,
- int min_width,
- int min_height,
- gfx::Rect* bounds) {
- AdjustBoundsSmallerThan(visible_area.size(), bounds);
-
- min_width = std::min(min_width, visible_area.width());
- min_height = std::min(min_height, visible_area.height());
-
- if (bounds->right() < visible_area.x() + min_width) {
- bounds->set_x(visible_area.x() + min_width - bounds->width());
- } else if (bounds->x() > visible_area.right() - min_width) {
- bounds->set_x(visible_area.right() - min_width);
- }
- if (bounds->bottom() < visible_area.y() + min_height) {
- bounds->set_y(visible_area.y() + min_height - bounds->height());
- } else if (bounds->y() > visible_area.bottom() - min_height) {
- bounds->set_y(visible_area.bottom() - min_height);
- }
- if (bounds->y() < visible_area.y())
- bounds->set_y(visible_area.y());
-}
-
bool MoveWindowToEventRoot(aura::Window* window, const ui::Event& event) {
views::View* target = static_cast<views::View*>(event.target());
if (!target)
« no previous file with comments | « ash/wm/window_util.h ('k') | ash/wm/window_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698