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

Unified Diff: ui/views/layout/layout_delegate.cc

Issue 2485083003: views: add layout delegates (Closed)
Patch Set: Created 4 years, 1 month 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: ui/views/layout/layout_delegate.cc
diff --git a/ui/views/layout/layout_delegate.cc b/ui/views/layout/layout_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..247158fcc8ae2da22003870006daf89e76f85907
--- /dev/null
+++ b/ui/views/layout/layout_delegate.cc
@@ -0,0 +1,40 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/views/layout/layout_constants.h"
+#include "ui/views/layout/layout_delegate.h"
+
+namespace views {
+
+int LayoutDelegate::GetLayoutDistance(LayoutDistanceType type) const {
+ switch (type) {
+ case PANEL_VERT_MARGIN:
+ return kPanelVertMargin;
+ case RELATED_BUTTON_HORIZONTAL_SPACING:
+ return kRelatedButtonHSpacing;
+ case RELATED_CONTROL_HORIZONTAL_SPACING:
+ return kRelatedControlHorizontalSpacing;
+ case RELATED_CONTROL_VERTICAL_SPACING:
+ return kRelatedControlVerticalSpacing;
+ case UNRELATED_CONTROL_VERTICAL_SPACING:
+ return kUnrelatedControlVerticalSpacing;
+ case UNRELATED_CONTROL_LARGE_VERTICAL_SPACING:
+ return kUnrelatedControlLargeVerticalSpacing;
+ case BUTTON_VEDGE_MARGIN_NEW:
+ return kButtonVEdgeMarginNew;
+ case BUTTON_HEDGE_MARGIN_NEW:
+ return kButtonHEdgeMarginNew;
+ }
+ return 0;
+}
+
+GridLayout::Alignment LayoutDelegate::GetControlLabelGridAlignment() const {
+ return kControlLabelGridAlignment;
+}
+
+bool LayoutDelegate::UseExtraDialogPadding() const {
+ return true;
+}
+
+} // namespace views

Powered by Google App Engine
This is Rietveld 408576698