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

Side by Side Diff: chrome/browser/ui/views/harmony/layout_delegate.h

Issue 2750063002: views: implement dialog width snapping (Closed)
Patch Set: width -> min_width and improve tests Created 3 years, 8 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_
6 #define CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_ 6 #define CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_
7 7
8 #include "ui/views/layout/grid_layout.h" 8 #include "ui/views/layout/grid_layout.h"
9 9
10 namespace views { 10 namespace views {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 UNRELATED_CONTROL_HORIZONTAL_SPACING_LARGE, 59 UNRELATED_CONTROL_HORIZONTAL_SPACING_LARGE,
60 // Vertical spacing between controls that are logically unrelated. 60 // Vertical spacing between controls that are logically unrelated.
61 UNRELATED_CONTROL_VERTICAL_SPACING, 61 UNRELATED_CONTROL_VERTICAL_SPACING,
62 // Larger vertical spacing between unrelated controls. 62 // Larger vertical spacing between unrelated controls.
63 UNRELATED_CONTROL_VERTICAL_SPACING_LARGE, 63 UNRELATED_CONTROL_VERTICAL_SPACING_LARGE,
64 // Padding to add to vector image buttons to increase their click and touch 64 // Padding to add to vector image buttons to increase their click and touch
65 // target size. 65 // target size.
66 VECTOR_IMAGE_BUTTON_PADDING, 66 VECTOR_IMAGE_BUTTON_PADDING,
67 }; 67 };
68 68
69 enum class DialogWidth { 69 enum class DialogWidth {
Peter Kasting 2017/04/06 07:37:50 This enum should disappear.
70 SMALL, 70 SMALL,
71 MEDIUM, 71 MEDIUM,
72 LARGE, 72 LARGE,
73 }; 73 };
74 74
75 LayoutDelegate() {} 75 LayoutDelegate() {}
76 virtual ~LayoutDelegate() {} 76 virtual ~LayoutDelegate() {}
77 77
78 // Returns the active LayoutDelegate singleton, depending on UI configuration. 78 // Returns the active LayoutDelegate singleton, depending on UI configuration.
79 // This may be an instance of this class or a subclass, e.g. a 79 // This may be an instance of this class or a subclass, e.g. a
(...skipping 20 matching lines...) Expand all
100 virtual bool ShouldShowWindowIcon() const; 100 virtual bool ShouldShowWindowIcon() const;
101 101
102 // DEPRECATED. Returns whether Harmony mode is enabled. 102 // DEPRECATED. Returns whether Harmony mode is enabled.
103 // 103 //
104 // Instead of using this, create a generic solution that works for all UI 104 // Instead of using this, create a generic solution that works for all UI
105 // types, e.g. by adding a new LayoutDistance value that means what you need. 105 // types, e.g. by adding a new LayoutDistance value that means what you need.
106 // 106 //
107 // TODO(pkasting): Fix callers and remove this. 107 // TODO(pkasting): Fix callers and remove this.
108 virtual bool IsHarmonyMode() const; 108 virtual bool IsHarmonyMode() const;
109 109
110 // Returns the preferred width in DIPs for a dialog of the specified |width|. 110 // Returns the preferred width in DIPs for a dialog of the specified
111 // May return 0 if the dialog has no preferred width. 111 // |min_width|. May return 0 if the dialog has no preferred width.
Peter Kasting 2017/04/06 06:32:16 Nit: Comment seems outdated. Maybe "Returns the a
112 virtual int GetDialogPreferredWidth(DialogWidth width) const; 112 virtual int GetSnappedDialogWidth(int min_width) const;
113 113
114 // Returns the class that maps views::style values (TextContext and TextStyle) 114 // Returns the class that maps views::style values (TextContext and TextStyle)
115 // to specific font properties (e.g. typeface, size, color, line spacing). 115 // to specific font properties (e.g. typeface, size, color, line spacing).
116 virtual const views::TypographyProvider& GetTypographyProvider() const; 116 virtual const views::TypographyProvider& GetTypographyProvider() const;
117 117
118 private: 118 private:
119 DISALLOW_COPY_AND_ASSIGN(LayoutDelegate); 119 DISALLOW_COPY_AND_ASSIGN(LayoutDelegate);
120 }; 120 };
121 121
122 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_ 122 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698