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

Unified Diff: chrome/browser/ui/views/harmony/layout_delegate.h

Issue 2485083003: views: add layout delegates (Closed)
Patch Set: move delegate out of views 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: chrome/browser/ui/views/harmony/layout_delegate.h
diff --git a/chrome/browser/ui/views/harmony/layout_delegate.h b/chrome/browser/ui/views/harmony/layout_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..ba009494a5f6a2c38c1fc9fc7032a26aa936aea3
--- /dev/null
+++ b/chrome/browser/ui/views/harmony/layout_delegate.h
@@ -0,0 +1,51 @@
+// 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.
+
+#ifndef CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_
+#define CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_
+
+#include "ui/views/layout/grid_layout.h"
+
+namespace chrome {
+
+class LayoutDelegate {
+ public:
+ enum LayoutDistanceType {
sky 2016/11/14 21:49:32 generally we're using enum class for new types.
Elly Fong-Jones 2016/11/15 17:13:39 Done.
+ PANEL_VERT_MARGIN,
+ RELATED_CONTROL_HORIZONTAL_SPACING,
+ RELATED_CONTROL_VERTICAL_SPACING,
+ RELATED_BUTTON_HORIZONTAL_SPACING,
+ UNRELATED_CONTROL_VERTICAL_SPACING,
+ UNRELATED_CONTROL_LARGE_VERTICAL_SPACING,
+ BUTTON_HEDGE_MARGIN_NEW,
+ BUTTON_VEDGE_MARGIN_NEW,
+ };
+
+ // Returns the singleton LayoutDelegate instance.
+ static LayoutDelegate* Get();
+
+ // Returns the active LayoutDelegate singleton, depending on UI configuration.
+ static LayoutDelegate* GetActiveInstance();
sky 2016/11/14 21:49:32 It isn't clear from this description how the value
Elly Fong-Jones 2016/11/15 17:13:39 Done.
+
+ // Returns a layout distance, indexed by |type|. These distances are in
+ // device-independent units.
+ virtual int GetLayoutDistance(LayoutDistanceType type) const;
+
+ // Returns the alignment used for control labels in a GridLayout; for example,
+ // in this GridLayout:
+ // ---------------------------
+ // | Label 1 Checkbox 1 |
+ // | Label 2 Checkbox 2 |
+ // ---------------------------
+ // This value controls the alignment used for "Label 1" and "Label 2".
+ virtual views::GridLayout::Alignment GetControlLabelGridAlignment() const;
+
+ // Returns whether to use extra padding on dialogs. If this is false, content
+ // Views for dialogs should not insert extra padding at their own edges.
+ virtual bool UseExtraDialogPadding() const;
+};
+
+} // namespace chrome
+
+#endif // CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698