Chromium Code Reviews| Index: ash/wm/workspace/snap_sizer.cc |
| diff --git a/ash/wm/workspace/snap_sizer.cc b/ash/wm/workspace/snap_sizer.cc |
| index 6403740ceb372b71bfaf411d89f0e0d9a697a62d..0d834273f952eab0b9636833fe7de885c4cb0bfd 100644 |
| --- a/ash/wm/workspace/snap_sizer.cc |
| +++ b/ash/wm/workspace/snap_sizer.cc |
| @@ -6,6 +6,7 @@ |
| #include <cmath> |
| +#include "ash/ash_switches.h" |
| #include "ash/screen_ash.h" |
| #include "ash/wm/property_util.h" |
| #include "ash/wm/window_resizer.h" |
| @@ -62,7 +63,16 @@ int GetMaxWidth(aura::Window* window) { |
| // in the SnapSizer. |
| int GetDefaultWidth(aura::Window* window) { |
| gfx::Rect work_area(ScreenAsh::GetDisplayWorkAreaBoundsInParent(window)); |
| - int width = std::max(kDefaultWidthSmallScreen, work_area.width() / 2); |
| + |
| + int width = 0; |
| + if (ash::switches::UseAlternateFrameCaptionButtonStyle()) { |
| + // Only the 'half of screen' width is supported when using the alternate |
| + // visual style for the frame caption buttons (minimize, maximize, restore, |
| + // and close). |
| + width = work_area.width() / 2; |
| + } else { |
| + width = std::max(kDefaultWidthSmallScreen, work_area.width() / 2); |
| + } |
| width = std::min(width, GetMaxWidth(window)); |
| return std::max(width, GetMinWidth(window)); |
| @@ -74,6 +84,13 @@ int GetDefaultWidth(aura::Window* window) { |
| // add an entry for 90% of the screen size if it is smaller than the biggest |
| // value in the |kIdealWidth| list (to get a step between the values). |
| std::vector<int> BuildIdealWidthList(aura::Window* window) { |
| + if (ash::switches::UseAlternateFrameCaptionButtonStyle()) { |
| + // Only the 'half of screen' width is supported when using the alternate |
| + // visual style for the frame caption buttons (minimize, maximize, |
| + // restore, and close). |
|
varkha
2013/09/09 15:47:55
nit: Instead of repeating the comment maybe just r
pkotwicz
2013/09/10 18:22:32
I do not think that this comment is long enough (a
|
| + return std::vector<int>(1u, GetDefaultWidth(window)); |
| + } |
| + |
| int minimum_width = GetMinWidth(window); |
| int maximum_width = GetMaxWidth(window); |