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

Side by Side Diff: ui/views/layout/views_layout_delegate.h

Issue 2758323002: Broke out layout metric information from ViewsDelegate to LayoutProvider (Closed)
Patch Set: Fix Bookmark and Global error unittests Created 3 years, 9 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 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 UI_VIEWS_LAYOUT_VIEWS_LAYOUT_DELEGATE_H_
6 #define UI_VIEWS_LAYOUT_VIEWS_LAYOUT_DELEGATE_H_
7
8 #include "base/macros.h"
9 #include "ui/gfx/geometry/insets.h"
10 #include "ui/views/style/typography_provider.h"
11 #include "ui/views/views_export.h"
12
13 namespace views {
14
15 enum class InsetsMetric {
16 // The margins that should be applied around a bubble dialog.
17 BUBBLE_DIALOG,
18 // The insets that should be applied around a DialogClientView. Note that
19 // the top inset is used for the distance between the buttons and the
20 // DialogClientView's content view.
21 DIALOG_BUTTON,
22 // The insets that should be applied around a dialog's frame view.
23 DIALOG_FRAME_VIEW,
24 };
25
26 enum class DistanceMetric {
27 // The default padding to add on each side of a button's label.
28 BUTTON_HORIZONTAL_PADDING,
29 // The distance between a dialog's edge and the close button in the upper
30 // trailing corner.
31 CLOSE_BUTTON_MARGIN,
32 // The default minimum width of a dialog button.
33 DIALOG_BUTTON_MINIMUM_WIDTH,
34 // The spacing between a pair of related horizontal buttons, used for
35 // dialog layout.
36 RELATED_BUTTON_HORIZONTAL,
37 // Horizontal spacing between controls that are logically related.
38 RELATED_CONTROL_HORIZONTAL,
39 // The spacing between a pair of related vertical controls, used for
40 // dialog layout.
41 RELATED_CONTROL_VERTICAL,
42 };
43
44 class VIEWS_EXPORT ViewsLayoutDelegate {
45 public:
46 ViewsLayoutDelegate();
47 virtual ~ViewsLayoutDelegate();
48
49 static ViewsLayoutDelegate* Get();
50
51 // Returns the insets metric according to the given enumeration element.
52 virtual gfx::Insets GetInsetsMetric(InsetsMetric metric) const;
53
54 // Returns the distance metric between elements according to the given
55 // enumeration element.
56 virtual int GetDistanceMetric(DistanceMetric metric) const;
57
58 // Returns the TypographyProvider, used to configure text properties such as
59 // font, weight, color, size, and line height. Never null.
60 virtual const TypographyProvider& GetTypographyProvider() const;
61
62 private:
63 DefaultTypographyProvider typography_provider_;
64
65 DISALLOW_COPY_AND_ASSIGN(ViewsLayoutDelegate);
66 };
67
68 } // namespace views
69
70 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698