Index: chrome/browser/ui/views/harmony/harmony_layout_delegate.cc |
diff --git a/chrome/browser/ui/views/harmony/harmony_layout_delegate.cc b/chrome/browser/ui/views/harmony/harmony_layout_delegate.cc |
index 8afd20369d3b97654914b2ba6851b72ac51e2eea..fe65ee36b8d1d88e56598e50d482039bb8926cb0 100644 |
--- a/chrome/browser/ui/views/harmony/harmony_layout_delegate.cc |
+++ b/chrome/browser/ui/views/harmony/harmony_layout_delegate.cc |
@@ -84,15 +84,11 @@ bool HarmonyLayoutDelegate::IsHarmonyMode() const { |
return true; |
} |
-int HarmonyLayoutDelegate::GetDialogPreferredWidth(DialogWidth width) const { |
- switch (width) { |
- case DialogWidth::SMALL: |
- return 320; |
- case DialogWidth::MEDIUM: |
- return 448; |
- case DialogWidth::LARGE: |
- return 512; |
+int HarmonyLayoutDelegate::GetSnappedDialogWidth(int min_width) const { |
+ for (int width : {320, 448, 512}) { |
+ if (min_width <= width) |
+ return width; |
} |
- NOTREACHED(); |
- return 0; |
+ return ((min_width + kHarmonyLayoutUnit - 1) / kHarmonyLayoutUnit) * |
+ kHarmonyLayoutUnit; |
} |