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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_layout.h

Issue 2713253002: Adjust ellision strategy for omnibox search chip. (Closed)
Patch Set: Created 3 years, 10 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 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 <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 // Second pass of decoration layout process. Pass the |entry_width| computed 62 // Second pass of decoration layout process. Pass the |entry_width| computed
63 // by the first pass. This pass will adjust it to account for resizable 63 // by the first pass. This pass will adjust it to account for resizable
64 // decorations. 64 // decorations.
65 void LayoutPass2(int* entry_width); 65 void LayoutPass2(int* entry_width);
66 66
67 // Third and final pass of decoration layout process. Pass the |bounds| 67 // Third and final pass of decoration layout process. Pass the |bounds|
68 // corresponding to the entire space available in the location bar. This pass 68 // corresponding to the entire space available in the location bar. This pass
69 // will update it as decorations are laid out. |available_width| measures the 69 // will update it as decorations are laid out. |available_width| measures the
70 // empty space within the location bar, taking the decorations and text into 70 // empty space within the location bar, taking the decorations and text into
71 // account. |decorations| must always be ordered from the edge of the location 71 // account. When |allow_collapse| is true, decorations may be completely
72 // bar towards the middle. 72 // collapsed (invisible) when there's not enough available width. When
73 void LayoutPass3(gfx::Rect* bounds, int* available_width); 73 // |allow_collapse| is false, decorations won't be smaller than their minimum
74 // width, even if there's not enough room in |available_width|.
75 void LayoutPass3(gfx::Rect* bounds,
76 int* available_width,
77 bool allow_collapse);
74 78
75 private: 79 private:
76 // LEFT_EDGE means decorations are added from left to right and stacked on 80 // LEFT_EDGE means decorations are added from left to right and stacked on
77 // the left of the omnibox, RIGHT_EDGE means the opposite. 81 // the left of the omnibox, RIGHT_EDGE means the opposite.
78 Position position_; 82 Position position_;
79 83
80 // The default padding between items. 84 // The default padding between items.
81 int item_padding_; 85 int item_padding_;
82 86
83 // The padding between the last decoration and the edit box. 87 // The padding between the last decoration and the edit box.
84 int item_edit_padding_; 88 int item_edit_padding_;
85 89
86 // The list of decorations to layout. 90 // The list of decorations to layout.
87 std::vector<std::unique_ptr<LocationBarDecoration>> decorations_; 91 std::vector<std::unique_ptr<LocationBarDecoration>> decorations_;
88 92
89 DISALLOW_COPY_AND_ASSIGN(LocationBarLayout); 93 DISALLOW_COPY_AND_ASSIGN(LocationBarLayout);
90 }; 94 };
91 95
92 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_LAYOUT_H_ 96 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_LAYOUT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698