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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 516943003: Add textfield internal padding from FocusableBorder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments; fix find bar offset. Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
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 cc226968c668f77c0591af2f8d498a0a712107e4..e7af8945a29297ce9bdd3bd1929391d128db74bb 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -647,7 +647,8 @@ gfx::Size LocationBarView::GetPreferredSize() const {
leading_width +=
kItemPadding + location_icon_view_->GetMinimumSize().width();
}
- leading_width += kItemPadding - GetEditLeadingInternalSpace();
+ leading_width += kItemPadding - views::Textfield::kTextPadding -
+ GetEditLeadingInternalSpace();
// Compute width of omnibox-trailing content.
int trailing_width = search_button_->visible() ?
@@ -659,7 +660,8 @@ gfx::Size LocationBarView::GetPreferredSize() const {
IncrementalMinimumWidth(manage_passwords_icon_view_) +
IncrementalMinimumWidth(zoom_view_) +
IncrementalMinimumWidth(generated_credit_card_view_) +
- IncrementalMinimumWidth(mic_search_view_) + kItemPadding;
+ IncrementalMinimumWidth(mic_search_view_) +
+ kItemPadding - views::Textfield::kTextPadding;
for (PageActionViews::const_iterator i(page_action_views_.begin());
i != page_action_views_.end(); ++i)
trailing_width += IncrementalMinimumWidth((*i));
@@ -682,11 +684,12 @@ void LocationBarView::Layout() {
ev_bubble_view_->SetVisible(false);
keyword_hint_view_->SetVisible(false);
+ const int edge_padding = kItemPadding - views::Textfield::kTextPadding;
Peter Kasting 2014/08/30 00:46:43 Nit: Good idea on the constant, why not do it in G
msw 2014/09/04 01:25:51 Done.
LocationBarLayout leading_decorations(
- LocationBarLayout::LEFT_EDGE,
- kItemPadding - GetEditLeadingInternalSpace());
+ LocationBarLayout::LEFT_EDGE,
+ edge_padding - GetEditLeadingInternalSpace());
LocationBarLayout trailing_decorations(LocationBarLayout::RIGHT_EDGE,
- kItemPadding);
+ edge_padding);
const int origin_chip_preferred_width =
origin_chip_view_->GetPreferredSize().width();

Powered by Google App Engine
This is Rietveld 408576698