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

Unified Diff: ash/wm/workspace/workspace_layout_manager2.cc

Issue 11087037: Dont allow the user to 'resize a window out of the workarea' (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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/workspace/workspace_layout_manager2.h ('k') | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/workspace_layout_manager2.cc
diff --git a/ash/wm/workspace/workspace_layout_manager2.cc b/ash/wm/workspace/workspace_layout_manager2.cc
index 7f3be99015d19cd01712dd79c7902b1226fd9d03..6731557b2189c504ac9831d30dd278668e1bce9b 100644
--- a/ash/wm/workspace/workspace_layout_manager2.cc
+++ b/ash/wm/workspace/workspace_layout_manager2.cc
@@ -27,6 +27,7 @@
using aura::Window;
namespace ash {
+
namespace internal {
namespace {
@@ -292,21 +293,20 @@ void WorkspaceLayoutManager2::AdjustWindowSizeForScreenChange(
} else if (reason == ADJUST_WINDOW_DISPLAY_INSETS_CHANGED) {
// If the window is completely outside the display work area, then move it
// enough to be visible again.
- const int kMinAreaVisible = 10;
gfx::Rect bounds = window->bounds();
if (!work_area_.Intersects(bounds)) {
int y_offset = 0;
if (work_area_.bottom() < bounds.y()) {
- y_offset = work_area_.bottom() - bounds.y() - kMinAreaVisible;
+ y_offset = work_area_.bottom() - bounds.y() - kMinimumOnScreenArea;
} else if (bounds.bottom() < work_area_.y()) {
- y_offset = work_area_.y() - bounds.bottom() + kMinAreaVisible;
+ y_offset = work_area_.y() - bounds.bottom() + kMinimumOnScreenArea;
}
int x_offset = 0;
if (work_area_.right() < bounds.x()) {
- x_offset = work_area_.right() - bounds.x() - kMinAreaVisible;
+ x_offset = work_area_.right() - bounds.x() - kMinimumOnScreenArea;
} else if (bounds.right() < work_area_.x()) {
- x_offset = work_area_.x() - bounds.right() + kMinAreaVisible;
+ x_offset = work_area_.x() - bounds.right() + kMinimumOnScreenArea;
}
bounds.Offset(x_offset, y_offset);
« no previous file with comments | « ash/wm/workspace/workspace_layout_manager2.h ('k') | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698