Chromium Code Reviews| Index: chrome/browser/ui/views/location_bar/location_bar_view.cc |
| diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| index d7ecd3b451b52c7b3072cb6045bd56869145412f..fb5f40f2429d2619ba932b37d4b874ef7bf89d65 100644 |
| --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| @@ -189,6 +189,7 @@ class IsPageActionViewRightAligned { |
| // static |
| const int LocationBarView::kNormalEdgeThickness = 2; |
| const int LocationBarView::kPopupEdgeThickness = 1; |
| +const int LocationBarView::kItemPadding = 3; |
| const int LocationBarView::kIconInternalPadding = 2; |
| const int LocationBarView::kBubblePadding = 1; |
| const char LocationBarView::kViewClassName[] = "LocationBarView"; |
| @@ -665,16 +666,6 @@ void LocationBarView::GetOmniboxPopupPositioningInfo( |
| *right_margin = *popup_width - location_bar_bounds.right(); |
| } |
| -// static |
| -int LocationBarView::GetItemPadding() { |
| - const int kTouchItemPadding = 8; |
| - if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) |
| - return kTouchItemPadding; |
| - |
| - const int kDesktopItemPadding = 3; |
| - return kDesktopItemPadding; |
| -} |
| - |
| //////////////////////////////////////////////////////////////////////////////// |
| // LocationBarView, public LocationBar implementation: |
| @@ -748,14 +739,12 @@ void LocationBarView::Layout() { |
| ev_bubble_view_->SetVisible(false); |
| keyword_hint_view_->SetVisible(false); |
| - const int item_padding = GetItemPadding(); |
| - |
| // The textfield has 1 px of whitespace before the text in the RTL case only. |
| const int kEditLeadingInternalSpace = base::i18n::IsRTL() ? 1 : 0; |
| LocationBarLayout leading_decorations( |
| - LocationBarLayout::LEFT_EDGE, item_padding - kEditLeadingInternalSpace); |
| + LocationBarLayout::LEFT_EDGE, kItemPadding - kEditLeadingInternalSpace); |
| LocationBarLayout trailing_decorations(LocationBarLayout::RIGHT_EDGE, |
| - item_padding); |
| + kItemPadding); |
| // Show and position the animated host label used in the show and hide URL |
| // animations. |
| @@ -812,7 +801,7 @@ void LocationBarView::Layout() { |
| const int bubble_height = std::max(location_height - (kBubblePadding * 2), 0); |
| if (!keyword.empty() && !is_keyword_hint) { |
| leading_decorations.AddDecoration(bubble_location_y, bubble_height, true, 0, |
| - kBubblePadding, item_padding, 0, |
| + kBubblePadding, kItemPadding, 0, |
| selected_keyword_view_); |
| if (selected_keyword_view_->keyword() != keyword) { |
| selected_keyword_view_->SetKeyword(keyword); |
| @@ -839,7 +828,7 @@ void LocationBarView::Layout() { |
| const double kMaxBubbleFraction = 0.5; |
| leading_decorations.AddDecoration(bubble_location_y, bubble_height, false, |
| kMaxBubbleFraction, kBubblePadding, |
| - item_padding, 0, ev_bubble_view_); |
| + kItemPadding, 0, ev_bubble_view_); |
| } else if (!origin_chip_view_->visible()) { |
| leading_decorations.AddDecoration( |
| vertical_edge_thickness(), location_height, |
| @@ -886,8 +875,8 @@ void LocationBarView::Layout() { |
| ++i) { |
| if ((*i)->visible()) { |
| trailing_decorations.AddDecoration( |
| - bubble_location_y, bubble_height, false, 0, item_padding, |
| - item_padding, GetBuiltInHorizontalPaddingForChildViews(), (*i)); |
| + bubble_location_y, bubble_height, false, 0, kItemPadding, |
| + kItemPadding, GetBuiltInHorizontalPaddingForChildViews(), (*i)); |
| } |
| } |
| if (generated_credit_card_view_->visible()) { |
| @@ -903,8 +892,8 @@ void LocationBarView::Layout() { |
| // IME composition is in progress. |
| if (!keyword.empty() && is_keyword_hint && !omnibox_view_->IsImeComposing()) { |
| trailing_decorations.AddDecoration(vertical_edge_thickness(), |
| - location_height, true, 0, item_padding, |
| - item_padding, 0, keyword_hint_view_); |
| + location_height, true, 0, kItemPadding, |
| + kItemPadding, 0, keyword_hint_view_); |
| if (keyword_hint_view_->keyword() != keyword) |
| keyword_hint_view_->SetKeyword(keyword); |
| } |
| @@ -1078,8 +1067,7 @@ WebContents* LocationBarView::GetWebContents() { |
| // static |
| int LocationBarView::GetBuiltInHorizontalPaddingForChildViews() { |
|
sky
2014/04/24 03:29:02
Can we remove this too?
oshima
2014/04/25 14:16:26
Done.
|
| - return (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) ? |
| - GetItemPadding() / 2 : 0; |
| + return 0; |
| } |
| int LocationBarView::GetHorizontalEdgeThickness() const { |