Commit bdaf4f4f authored by Tommy C. Li's avatar Tommy C. Li Committed by Commit Bot

Omnibox UI Refresh: Update naming of OmniboxMatchCellView constants

This CL has no behavioral changes and is a name clarification only.

1) kRichSuggestionMarginHeight => kRefreshTwoLineRowMarginHeight

   We are using this margin height for all two-line suggestions, which
   include tab-switch suggestions and old-style answers in addition
   to rich entity suggestions. This rename makes that explicit.

2) "Split" suggestions => "One-line" suggestions.

   We originally named these split suggestions because the title and URL
   were split by a hyphen.

   However, since we are calling two-line suggestions "two-line", I
   think calling these "one-line" suggestions would be most clear.

Bug: 863982
Change-Id: Id56f6798c9a609276bbd0b0de5e565a3cf2cd475
Reviewed-on: https://chromium-review.googlesource.com/1141207
Commit-Queue: Tommy Li <tommycli@chromium.org>
Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576115}
parent 5ac266ef
......@@ -58,11 +58,11 @@ static constexpr int kEntityImageCornerRadius = 4;
// suggestion.
static constexpr int kMinVerticalMargin = 1;
// The margin height of a split row when MD refresh is enabled.
static constexpr int kRefreshSplitMarginHeight = 8;
// The margin height of a one-line suggestion row when MD Refresh is enabled.
static constexpr int kRefreshOneLineRowMarginHeight = 8;
// The margin height of a rich suggestion row.
static constexpr int kRichSuggestionMarginHeight = 4;
// The margin height of a two-line suggestion row when MD Refresh is enabled.
static constexpr int kRefreshTwoLineRowMarginHeight = 4;
// Returns the padding width between elements.
int HorizontalPadding() {
......@@ -106,10 +106,10 @@ gfx::Insets GetMarginInsets(int text_height, bool is_two_line) {
// TODO(dschuyler): Consider adding a right-hand margin to each |return|.
if (ui::MaterialDesignController::IsRefreshUi()) {
return is_two_line
? gfx::Insets(kRichSuggestionMarginHeight, kRefreshMarginLeft,
kRichSuggestionMarginHeight, 0)
: gfx::Insets(kRefreshSplitMarginHeight, kRefreshMarginLeft,
kRefreshSplitMarginHeight, 0);
? gfx::Insets(kRefreshTwoLineRowMarginHeight, kRefreshMarginLeft,
kRefreshTwoLineRowMarginHeight, 0)
: gfx::Insets(kRefreshOneLineRowMarginHeight, kRefreshMarginLeft,
kRefreshOneLineRowMarginHeight, 0);
}
// Regardless of the text size, we ensure a minimum size for the content line
......@@ -430,7 +430,7 @@ void OmniboxMatchCellView::Layout() {
} else if (is_old_style_answer_) {
LayoutOldStyleAnswer(icon_view_width, text_indent);
} else {
LayoutSplit(icon_view_width, text_indent);
LayoutOneLineSuggestion(icon_view_width, text_indent);
}
}
......@@ -487,7 +487,8 @@ void OmniboxMatchCellView::LayoutNewStyleTwoLineSuggestion() {
}
}
void OmniboxMatchCellView::LayoutSplit(int icon_view_width, int text_indent) {
void OmniboxMatchCellView::LayoutOneLineSuggestion(int icon_view_width,
int text_indent) {
gfx::Rect child_area = GetContentsBounds();
int row_height = child_area.height();
int y = child_area.y();
......
......@@ -44,7 +44,7 @@ class OmniboxMatchCellView : public views::View {
void LayoutOldStyleAnswer(int icon_view_width, int text_indent);
void LayoutNewStyleTwoLineSuggestion();
void LayoutSplit(int icon_view_width, int text_indent);
void LayoutOneLineSuggestion(int icon_view_width, int text_indent);
bool is_old_style_answer_;
bool is_rich_suggestion_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment