OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_LOCATION_BAR_LOCATION_BAR_LAYOUT_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_LAYOUT_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_LAYOUT_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_LAYOUT_H_ |
7 | 7 |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 | 9 |
10 namespace gfx { | 10 namespace gfx { |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 // Add a decoration, specifying: | 32 // Add a decoration, specifying: |
33 // - The |y| position inside its parent; | 33 // - The |y| position inside its parent; |
34 // - The |height| in pixel, 0 meaning the preferred height of the |view|; | 34 // - The |height| in pixel, 0 meaning the preferred height of the |view|; |
35 // - Whether the decoration should |auto_collapse| if there is no room for it; | 35 // - Whether the decoration should |auto_collapse| if there is no room for it; |
36 // - The |max_fraction| it can use within the omnibox, or 0 for non-resizable | 36 // - The |max_fraction| it can use within the omnibox, or 0 for non-resizable |
37 // decorations; | 37 // decorations; |
38 // - |edge_item_padding|, the padding between the omnibox edge and the item, | 38 // - |edge_item_padding|, the padding between the omnibox edge and the item, |
39 // if the item is the first one drawn; | 39 // if the item is the first one drawn; |
40 // - |item_padding|, the padding between the previous item and this one; | 40 // - |item_padding|, the padding between the previous item and this one; |
41 // - |builtin_padding|, any padding directly built into the item; | |
42 // - The |view| corresponding to this decoration, a weak pointer. | 41 // - The |view| corresponding to this decoration, a weak pointer. |
43 // Note that |auto_collapse| can be true if and only if |max_fraction| is 0. | 42 // Note that |auto_collapse| can be true if and only if |max_fraction| is 0. |
44 void AddDecoration(int y, | 43 void AddDecoration(int y, |
45 int height, | 44 int height, |
46 bool auto_collapse, | 45 bool auto_collapse, |
47 double max_fraction, | 46 double max_fraction, |
48 int edge_item_padding, | 47 int edge_item_padding, |
49 int item_padding, | 48 int item_padding, |
50 int builtin_padding, | |
51 views::View* view); | 49 views::View* view); |
52 | 50 |
53 // Add a non-resizable decoration with standard padding. | 51 // Add a non-resizable decoration with standard padding. |
54 void AddDecoration(int y, int height, int builtin_padding, views::View* view); | 52 void AddDecoration(int y, int height, views::View* view); |
55 | 53 |
56 // First pass of decoration layout process. Pass the full width of the | 54 // First pass of decoration layout process. Pass the full width of the |
57 // location bar in |entry_width|. This pass will adjust it to account for | 55 // location bar in |entry_width|. This pass will adjust it to account for |
58 // non-collapsible and non-resizable decorations. | 56 // non-collapsible and non-resizable decorations. |
59 void LayoutPass1(int* entry_width); | 57 void LayoutPass1(int* entry_width); |
60 | 58 |
61 // Second pass of decoration layout process. Pass the |entry_width| computed | 59 // Second pass of decoration layout process. Pass the |entry_width| computed |
62 // by the first pass. This pass will adjust it to account for resizable | 60 // by the first pass. This pass will adjust it to account for resizable |
63 // decorations. | 61 // decorations. |
64 void LayoutPass2(int* entry_width); | 62 void LayoutPass2(int* entry_width); |
(...skipping 16 matching lines...) Expand all Loading... |
81 // The padding between the last decoration and the edit box. | 79 // The padding between the last decoration and the edit box. |
82 int item_edit_padding_; | 80 int item_edit_padding_; |
83 | 81 |
84 // The list of decorations to layout. | 82 // The list of decorations to layout. |
85 Decorations decorations_; | 83 Decorations decorations_; |
86 | 84 |
87 DISALLOW_COPY_AND_ASSIGN(LocationBarLayout); | 85 DISALLOW_COPY_AND_ASSIGN(LocationBarLayout); |
88 }; | 86 }; |
89 | 87 |
90 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_LAYOUT_H_ | 88 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_LAYOUT_H_ |
OLD | NEW |