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

Unified Diff: chrome/browser/ui/views/harmony/harmony_layout_provider.cc

Issue 2888563004: Delete panel metrics and define insets in terms of distance metrics. (Closed)
Patch Set: one wrong conversion Created 3 years, 7 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
Index: chrome/browser/ui/views/harmony/harmony_layout_provider.cc
diff --git a/chrome/browser/ui/views/harmony/harmony_layout_provider.cc b/chrome/browser/ui/views/harmony/harmony_layout_provider.cc
index d11ef463049ec5123e53da85b29718e661878784..fd1c37ad613a1a9663fb52d55b1a9c9c81b6b381 100644
--- a/chrome/browser/ui/views/harmony/harmony_layout_provider.cc
+++ b/chrome/browser/ui/views/harmony/harmony_layout_provider.cc
@@ -7,27 +7,21 @@
gfx::Insets HarmonyLayoutProvider::GetInsetsMetric(int metric) const {
DCHECK_LT(metric, views::VIEWS_INSETS_MAX);
switch (metric) {
- case views::INSETS_DIALOG_BUTTON:
- case views::INSETS_PANEL:
- case views::INSETS_BUBBLE_CONTENTS:
- return gfx::Insets(kHarmonyLayoutUnit);
- case views::INSETS_BUBBLE_TITLE:
- case views::INSETS_DIALOG_TITLE: {
- constexpr int top = kHarmonyLayoutUnit;
- constexpr int side = kHarmonyLayoutUnit;
- // Titles are inset at the top and sides, but not at the bottom.
- return gfx::Insets(top, side, 0, side);
- }
case views::INSETS_VECTOR_IMAGE_BUTTON:
return gfx::Insets(kHarmonyLayoutUnit / 4);
+ default:
+ return ChromeLayoutProvider::GetInsetsMetric(metric);
}
- NOTREACHED();
- return gfx::Insets();
}
int HarmonyLayoutProvider::GetDistanceMetric(int metric) const {
DCHECK_GE(metric, views::VIEWS_INSETS_MAX);
switch (metric) {
+ case views::DISTANCE_BUBBLE_CONTENTS_HORIZONTAL_MARGIN:
+ case views::DISTANCE_BUBBLE_CONTENTS_VERTICAL_MARGIN:
+ case views::DISTANCE_DIALOG_CONTENTS_HORIZONTAL_MARGIN:
+ case views::DISTANCE_DIALOG_CONTENTS_VERTICAL_MARGIN:
+ return kHarmonyLayoutUnit;
case DISTANCE_CONTROL_LIST_VERTICAL:
return kHarmonyLayoutUnit * 3 / 4;
case views::DISTANCE_CLOSE_BUTTON_MARGIN: {
@@ -46,7 +40,7 @@ int HarmonyLayoutProvider::GetDistanceMetric(int metric) const {
return kHarmonyLayoutUnit / 2;
case DISTANCE_RELATED_CONTROL_VERTICAL_SMALL:
return kHarmonyLayoutUnit / 2;
- case DISTANCE_DIALOG_BUTTON_MARGIN:
+ case views::DISTANCE_DIALOG_BUTTON_BOTTOM_MARGIN:
return kHarmonyLayoutUnit;
case DISTANCE_DIALOG_BUTTON_TOP:
return kHarmonyLayoutUnit;
@@ -63,8 +57,6 @@ int HarmonyLayoutProvider::GetDistanceMetric(int metric) const {
return kHarmonyLayoutUnit;
case DISTANCE_SUBSECTION_HORIZONTAL_INDENT:
return 0;
- case DISTANCE_PANEL_CONTENT_MARGIN:
- return kHarmonyLayoutUnit;
case DISTANCE_UNRELATED_CONTROL_HORIZONTAL:
return kHarmonyLayoutUnit;
case DISTANCE_UNRELATED_CONTROL_HORIZONTAL_LARGE:
« no previous file with comments | « chrome/browser/ui/views/harmony/chrome_layout_provider.cc ('k') | chrome/browser/ui/views/importer/import_lock_dialog_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698