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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_
6 #define CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_
7
8 #include "ui/views/layout/grid_layout.h"
9
10 namespace chrome {
11
12 class LayoutDelegate {
13 public:
14 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.
15 PANEL_VERT_MARGIN,
16 RELATED_CONTROL_HORIZONTAL_SPACING,
17 RELATED_CONTROL_VERTICAL_SPACING,
18 RELATED_BUTTON_HORIZONTAL_SPACING,
19 UNRELATED_CONTROL_VERTICAL_SPACING,
20 UNRELATED_CONTROL_LARGE_VERTICAL_SPACING,
21 BUTTON_HEDGE_MARGIN_NEW,
22 BUTTON_VEDGE_MARGIN_NEW,
23 };
24
25 // Returns the singleton LayoutDelegate instance.
26 static LayoutDelegate* Get();
27
28 // Returns the active LayoutDelegate singleton, depending on UI configuration.
29 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.
30
31 // Returns a layout distance, indexed by |type|. These distances are in
32 // device-independent units.
33 virtual int GetLayoutDistance(LayoutDistanceType type) const;
34
35 // Returns the alignment used for control labels in a GridLayout; for example,
36 // in this GridLayout:
37 // ---------------------------
38 // | Label 1 Checkbox 1 |
39 // | Label 2 Checkbox 2 |
40 // ---------------------------
41 // This value controls the alignment used for "Label 1" and "Label 2".
42 virtual views::GridLayout::Alignment GetControlLabelGridAlignment() const;
43
44 // Returns whether to use extra padding on dialogs. If this is false, content
45 // Views for dialogs should not insert extra padding at their own edges.
46 virtual bool UseExtraDialogPadding() const;
47 };
48
49 } // namespace chrome
50
51 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698