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

Unified Diff: ash/wm/window_resizer.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_positioner_unittest.cc ('k') | ash/wm/window_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_resizer.cc
diff --git a/ash/wm/window_resizer.cc b/ash/wm/window_resizer.cc
index f6ea1c0764c7c6b1ab797aef390a53d29844635b..c0f2ca595a8fbd9155f58668dcb670eab7cbf543 100644
--- a/ash/wm/window_resizer.cc
+++ b/ash/wm/window_resizer.cc
@@ -7,6 +7,7 @@
#include "ash/screen_util.h"
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
+#include "ash/wm/common/window_positioning_utils.h"
#include "ash/wm/coordinate_conversion.h"
#include "ash/wm/dock/docked_window_layout_manager.h"
#include "ash/wm/window_state.h"
@@ -151,22 +152,24 @@ gfx::Rect WindowResizer::CalculateBoundsForDrag(
work_area);
if (details().size_change_direction & kBoundsChangeDirection_Horizontal) {
if (IsRightEdge(details().window_component) &&
- new_bounds.right() < work_area.x() + kMinimumOnScreenArea) {
- int delta = work_area.x() + kMinimumOnScreenArea - new_bounds.right();
+ new_bounds.right() < work_area.x() + wm::kMinimumOnScreenArea) {
+ int delta =
+ work_area.x() + wm::kMinimumOnScreenArea - new_bounds.right();
new_bounds.set_width(new_bounds.width() + delta);
- } else if (new_bounds.x() > work_area.right() - kMinimumOnScreenArea) {
- int width = new_bounds.right() - work_area.right() +
- kMinimumOnScreenArea;
- new_bounds.set_x(work_area.right() - kMinimumOnScreenArea);
+ } else if (new_bounds.x() >
+ work_area.right() - wm::kMinimumOnScreenArea) {
+ int width =
+ new_bounds.right() - work_area.right() + wm::kMinimumOnScreenArea;
+ new_bounds.set_x(work_area.right() - wm::kMinimumOnScreenArea);
new_bounds.set_width(width);
}
}
if (details().size_change_direction & kBoundsChangeDirection_Vertical) {
if (!IsBottomEdge(details().window_component) &&
- new_bounds.y() > work_area.bottom() - kMinimumOnScreenArea) {
- int height = new_bounds.bottom() - work_area.bottom() +
- kMinimumOnScreenArea;
- new_bounds.set_y(work_area.bottom() - kMinimumOnScreenArea);
+ new_bounds.y() > work_area.bottom() - wm::kMinimumOnScreenArea) {
+ int height =
+ new_bounds.bottom() - work_area.bottom() + wm::kMinimumOnScreenArea;
+ new_bounds.set_y(work_area.bottom() - wm::kMinimumOnScreenArea);
new_bounds.set_height(height);
} else if (details().window_component == HTBOTTOM ||
details().window_component == HTBOTTOMRIGHT ||
@@ -218,7 +221,7 @@ gfx::Rect WindowResizer::CalculateBoundsForDrag(
gfx::Rect screen_work_area = display.work_area();
screen_work_area.Union(dock_layout->docked_bounds());
- screen_work_area.Inset(kMinimumOnScreenArea, 0);
+ screen_work_area.Inset(wm::kMinimumOnScreenArea, 0);
gfx::Rect new_bounds_in_screen =
ScreenUtil::ConvertRectToScreen(parent, new_bounds);
if (!screen_work_area.Intersects(new_bounds_in_screen)) {
« no previous file with comments | « ash/wm/window_positioner_unittest.cc ('k') | ash/wm/window_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698