| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/wm/window_resizer.h" | 5 #include "ash/wm/window_resizer.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ui/aura/client/aura_constants.h" | 8 #include "ui/aura/client/aura_constants.h" |
| 9 #include "ui/aura/root_window.h" | 9 #include "ui/aura/root_window.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 width = adjusted_width; | 285 width = adjusted_width; |
| 286 } | 286 } |
| 287 | 287 |
| 288 // Ensure we don't shrink past the minimum width and clamp delta_x | 288 // Ensure we don't shrink past the minimum width and clamp delta_x |
| 289 // for the window origin computation. | 289 // for the window origin computation. |
| 290 if (width < min_width) { | 290 if (width < min_width) { |
| 291 width = min_width; | 291 width = min_width; |
| 292 *delta_x = -x_multiplier * (details.initial_bounds.width() - min_width); | 292 *delta_x = -x_multiplier * (details.initial_bounds.width() - min_width); |
| 293 } | 293 } |
| 294 | 294 |
| 295 // And don't let the window go bigger than the monitor. | 295 // And don't let the window go bigger than the display. |
| 296 int max_width = | 296 int max_width = |
| 297 gfx::Screen::GetDisplayNearestWindow(details.window).bounds().width(); | 297 gfx::Screen::GetDisplayNearestWindow(details.window).bounds().width(); |
| 298 if (width > max_width) { | 298 if (width > max_width) { |
| 299 width = max_width; | 299 width = max_width; |
| 300 *delta_x = -x_multiplier * (details.initial_bounds.width() - max_width); | 300 *delta_x = -x_multiplier * (details.initial_bounds.width() - max_width); |
| 301 } | 301 } |
| 302 } | 302 } |
| 303 return width; | 303 return width; |
| 304 } | 304 } |
| 305 | 305 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 319 height = adjusted_height; | 319 height = adjusted_height; |
| 320 } | 320 } |
| 321 | 321 |
| 322 // Ensure we don't shrink past the minimum height and clamp delta_y | 322 // Ensure we don't shrink past the minimum height and clamp delta_y |
| 323 // for the window origin computation. | 323 // for the window origin computation. |
| 324 if (height < min_height) { | 324 if (height < min_height) { |
| 325 height = min_height; | 325 height = min_height; |
| 326 *delta_y = -y_multiplier * (details.initial_bounds.height() - min_height); | 326 *delta_y = -y_multiplier * (details.initial_bounds.height() - min_height); |
| 327 } | 327 } |
| 328 | 328 |
| 329 // And don't let the window go bigger than the monitor. | 329 // And don't let the window go bigger than the display. |
| 330 int max_height = | 330 int max_height = |
| 331 gfx::Screen::GetDisplayNearestWindow(details.window).bounds().height(); | 331 gfx::Screen::GetDisplayNearestWindow(details.window).bounds().height(); |
| 332 if (height > max_height) { | 332 if (height > max_height) { |
| 333 height = max_height; | 333 height = max_height; |
| 334 *delta_y = -y_multiplier * (details.initial_bounds.height() - max_height); | 334 *delta_y = -y_multiplier * (details.initial_bounds.height() - max_height); |
| 335 } | 335 } |
| 336 } | 336 } |
| 337 return height; | 337 return height; |
| 338 } | 338 } |
| 339 | 339 |
| 340 } // namespace aura | 340 } // namespace aura |
| OLD | NEW |