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

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

Issue 2942453002: Remove references to ui/views/layout/layout_constants.h (Closed)
Patch Set: Address redness Created 3 years, 6 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 | « no previous file | ui/views/BUILD.gn » ('j') | ui/views/layout/layout_provider.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/harmony/chrome_layout_provider.cc
diff --git a/chrome/browser/ui/views/harmony/chrome_layout_provider.cc b/chrome/browser/ui/views/harmony/chrome_layout_provider.cc
index a66a6b4aa37f9b4689cbe8ac63f9df4da22eae29..215883043acc4913861d9c181f32a0b046deee0c 100644
--- a/chrome/browser/ui/views/harmony/chrome_layout_provider.cc
+++ b/chrome/browser/ui/views/harmony/chrome_layout_provider.cc
@@ -9,7 +9,35 @@
#include "chrome/browser/ui/views/harmony/chrome_typography.h"
#include "chrome/browser/ui/views/harmony/harmony_layout_provider.h"
#include "ui/base/material_design/material_design_controller.h"
-#include "ui/views/layout/layout_constants.h"
+
+namespace {
+
+// Default minimum width of buttons.
+constexpr int kMinimumButtonWidth = 48;
Peter Kasting 2017/06/13 23:33:35 I would inline these directly into their single us
ananta 2017/06/14 18:48:11 Done.
+
+// Small horizontal spacing between controls that are logically related.
+constexpr int kRelatedControlSmallHorizontalSpacing = 8;
+
+// Small vertical spacing between controls that are logically related.
+constexpr int kRelatedControlSmallVerticalSpacing = 4;
+
+// Horizontal spacing between controls that are logically unrelated.
+constexpr int kUnrelatedControlHorizontalSpacing = 12;
+
+// Larger horizontal spacing between unrelated controls.
+constexpr int kUnrelatedControlLargeHorizontalSpacing = 20;
+
+// Larger vertical spacing between unrelated controls.
+constexpr int kUnrelatedControlLargeVerticalSpacing = 30;
+
+// Horizontal spacing between the end of an item (i.e. an icon or a checkbox)
+// and the start of its corresponding text.
+constexpr int kItemLabelSpacing = 10;
+
+// Indent of checkboxes relative to related text.
+constexpr int kCheckboxIndent = 10;
+
+} // namespace
// static
ChromeLayoutProvider* ChromeLayoutProvider::Get() {
@@ -27,25 +55,25 @@ ChromeLayoutProvider::CreateLayoutProvider() {
int ChromeLayoutProvider::GetDistanceMetric(int metric) const {
switch (metric) {
case DISTANCE_BUTTON_MINIMUM_WIDTH:
- return views::kMinimumButtonWidth;
+ return kMinimumButtonWidth;
case DISTANCE_CONTROL_LIST_VERTICAL:
return GetDistanceMetric(views::DISTANCE_UNRELATED_CONTROL_VERTICAL);
case DISTANCE_DIALOG_BUTTON_TOP:
return 0;
case DISTANCE_RELATED_CONTROL_HORIZONTAL_SMALL:
- return views::kRelatedControlSmallHorizontalSpacing;
+ return kRelatedControlSmallHorizontalSpacing;
case DISTANCE_RELATED_CONTROL_VERTICAL_SMALL:
- return views::kRelatedControlSmallVerticalSpacing;
+ return kRelatedControlSmallVerticalSpacing;
case DISTANCE_RELATED_LABEL_HORIZONTAL:
- return views::kItemLabelSpacing;
+ return kItemLabelSpacing;
case DISTANCE_SUBSECTION_HORIZONTAL_INDENT:
- return views::kCheckboxIndent;
+ return kCheckboxIndent;
case DISTANCE_UNRELATED_CONTROL_HORIZONTAL:
- return views::kUnrelatedControlHorizontalSpacing;
+ return kUnrelatedControlHorizontalSpacing;
case DISTANCE_UNRELATED_CONTROL_HORIZONTAL_LARGE:
- return views::kUnrelatedControlLargeHorizontalSpacing;
+ return kUnrelatedControlLargeHorizontalSpacing;
case DISTANCE_UNRELATED_CONTROL_VERTICAL_LARGE:
- return views::kUnrelatedControlLargeVerticalSpacing;
+ return kUnrelatedControlLargeVerticalSpacing;
default:
return views::LayoutProvider::GetDistanceMetric(metric);
}
« no previous file with comments | « no previous file | ui/views/BUILD.gn » ('j') | ui/views/layout/layout_provider.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698