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

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

Issue 2511163002: harmony: convert collected cookies dialog (Closed)
Patch Set: remove ?: 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
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 class LayoutDelegate { 10 class LayoutDelegate {
11 public: 11 public:
12 enum class LayoutDistanceType { 12 enum class LayoutDistanceType {
13 PANEL_VERT_MARGIN, 13 PANEL_VERT_MARGIN,
14 RELATED_CONTROL_HORIZONTAL_SPACING, 14 RELATED_CONTROL_HORIZONTAL_SPACING,
15 RELATED_CONTROL_VERTICAL_SPACING, 15 RELATED_CONTROL_VERTICAL_SPACING,
16 RELATED_BUTTON_HORIZONTAL_SPACING, 16 RELATED_BUTTON_HORIZONTAL_SPACING,
17 UNRELATED_CONTROL_VERTICAL_SPACING, 17 UNRELATED_CONTROL_VERTICAL_SPACING,
18 UNRELATED_CONTROL_LARGE_VERTICAL_SPACING, 18 UNRELATED_CONTROL_LARGE_VERTICAL_SPACING,
19 BUTTON_HEDGE_MARGIN_NEW, 19 BUTTON_HEDGE_MARGIN_NEW,
20 BUTTON_VEDGE_MARGIN_NEW, 20 BUTTON_VEDGE_MARGIN_NEW,
21 }; 21 };
22 22
23 enum class DialogWidthType {
24 SMALL,
25 MEDIUM,
26 LARGE,
27 };
28
23 LayoutDelegate() {} 29 LayoutDelegate() {}
24 virtual ~LayoutDelegate() {} 30 virtual ~LayoutDelegate() {}
25 31
26 // Returns the active LayoutDelegate singleton, depending on UI configuration. 32 // Returns the active LayoutDelegate singleton, depending on UI configuration.
27 // By default, this is the same instance returned by Get(), but if Harmony 33 // By default, this is the same instance returned by Get(), but if Harmony
28 // or another UI style is enabled, this may be an instance of a LayoutDelegate 34 // or another UI style is enabled, this may be an instance of a LayoutDelegate
29 // subclass instead. 35 // subclass instead.
30 static LayoutDelegate* Get(); 36 static LayoutDelegate* Get();
31 37
32 // Returns a layout distance, indexed by |type|. These distances are in 38 // Returns a layout distance, indexed by |type|. These distances are in
33 // device-independent units. 39 // device-independent units.
34 virtual int GetLayoutDistance(LayoutDistanceType type) const; 40 virtual int GetLayoutDistance(LayoutDistanceType type) const;
35 41
36 // Returns the alignment used for control labels in a GridLayout; for example, 42 // Returns the alignment used for control labels in a GridLayout; for example,
37 // in this GridLayout: 43 // in this GridLayout:
38 // --------------------------- 44 // ---------------------------
39 // | Label 1 Checkbox 1 | 45 // | Label 1 Checkbox 1 |
40 // | Label 2 Checkbox 2 | 46 // | Label 2 Checkbox 2 |
41 // --------------------------- 47 // ---------------------------
42 // This value controls the alignment used for "Label 1" and "Label 2". 48 // This value controls the alignment used for "Label 1" and "Label 2".
43 virtual views::GridLayout::Alignment GetControlLabelGridAlignment() const; 49 virtual views::GridLayout::Alignment GetControlLabelGridAlignment() const;
44 50
45 // Returns whether to use extra padding on dialogs. If this is false, content 51 // Returns whether to use extra padding on dialogs. If this is false, content
46 // Views for dialogs should not insert extra padding at their own edges. 52 // Views for dialogs should not insert extra padding at their own edges.
47 virtual bool UseExtraDialogPadding() const; 53 virtual bool UseExtraDialogPadding() const;
48 54
55 // Returns whether Harmony mode is enabled. This method is deprecated and
56 // should only be used in dire circumstances, such as when Harmony specifies a
57 // different distance type than was previously used.
58 virtual bool IsHarmonyMode() const;
59
60 // Returns the preferred width for a dialog of the specified width type. If
61 // there is no preferred width for |type|, returns 0.
62 virtual int GetDialogPreferredWidth(DialogWidthType type) const;
63
49 private: 64 private:
50 DISALLOW_COPY_AND_ASSIGN(LayoutDelegate); 65 DISALLOW_COPY_AND_ASSIGN(LayoutDelegate);
51 }; 66 };
52 67
53 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_ 68 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/harmony/harmony_layout_delegate.cc ('k') | chrome/browser/ui/views/harmony/layout_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698