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

Unified Diff: ash/wm/default_state.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/common/wm_window.h ('k') | ash/wm/drag_window_resizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/default_state.cc
diff --git a/ash/wm/default_state.cc b/ash/wm/default_state.cc
index 769dcb19403a2355c1f2f468888628784420fa2b..4aab8da91c83b13fadac0985fbc8cc1c6ec41b92 100644
--- a/ash/wm/default_state.cc
+++ b/ash/wm/default_state.cc
@@ -9,6 +9,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/common/wm_event.h"
#include "ash/wm/coordinate_conversion.h"
#include "ash/wm/dock/docked_window_layout_manager.h"
@@ -440,10 +441,10 @@ bool DefaultState::ProcessWorkspaceEvents(WindowState* window_state,
// visibility which should be enough to see where the window gets
// moved.
gfx::Rect display_area = ScreenUtil::GetDisplayBoundsInParent(window);
- int min_width = bounds.width() * kMinimumPercentOnScreenArea;
- int min_height = bounds.height() * kMinimumPercentOnScreenArea;
- AdjustBoundsToEnsureWindowVisibility(
- display_area, min_width, min_height, &bounds);
+ int min_width = bounds.width() * wm::kMinimumPercentOnScreenArea;
+ int min_height = bounds.height() * wm::kMinimumPercentOnScreenArea;
+ wm::AdjustBoundsToEnsureWindowVisibility(display_area, min_width,
+ min_height, &bounds);
window_state->AdjustSnappedBounds(&bounds);
if (window->bounds() != bounds)
window_state->SetBoundsConstrained(bounds);
@@ -484,7 +485,8 @@ bool DefaultState::ProcessWorkspaceEvents(WindowState* window_state,
ScreenUtil::GetDisplayWorkAreaBoundsInParent(
window_state->aura_window());
gfx::Rect bounds = window_state->aura_window()->bounds();
- AdjustBoundsToEnsureMinimumWindowVisibility(work_area_in_parent, &bounds);
+ wm::AdjustBoundsToEnsureMinimumWindowVisibility(work_area_in_parent,
+ &bounds);
window_state->AdjustSnappedBounds(&bounds);
if (window_state->aura_window()->bounds() != bounds)
window_state->SetBoundsDirectAnimated(bounds);
@@ -540,7 +542,7 @@ void DefaultState::SetBounds(WindowState* window_state,
ScreenUtil::GetDisplayWorkAreaBoundsInParent(
window_state->aura_window());
gfx::Rect child_bounds(event->requested_bounds());
- AdjustBoundsSmallerThan(work_area_in_parent.size(), &child_bounds);
+ wm::AdjustBoundsSmallerThan(work_area_in_parent.size(), &child_bounds);
window_state->AdjustSnappedBounds(&child_bounds);
window_state->SetBoundsDirect(child_bounds);
} else if (!SetMaximizedOrFullscreenBounds(window_state)) {
@@ -677,8 +679,8 @@ void DefaultState::UpdateBoundsFromState(WindowState* window_state,
bounds_in_parent = window->bounds();
}
// Make sure that part of the window is always visible.
- AdjustBoundsToEnsureMinimumWindowVisibility(
- work_area_in_parent, &bounds_in_parent);
+ wm::AdjustBoundsToEnsureMinimumWindowVisibility(work_area_in_parent,
+ &bounds_in_parent);
break;
}
case WINDOW_STATE_TYPE_MAXIMIZED:
« no previous file with comments | « ash/wm/common/wm_window.h ('k') | ash/wm/drag_window_resizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698