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

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

Issue 2748103013: Adjust elision of omnibox keyword search label. (Closed)
Patch Set: Created 3 years, 9 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 5e588a8186f4fa94e36b350c88698c78198f9583..eb9c5e0c60eaefb3f701a350368199389bced466 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -486,12 +486,15 @@ void LocationBarView::Layout() {
// hits ctrl-d).
const int vertical_padding = GetTotalVerticalPadding();
const int location_height = std::max(height() - (vertical_padding * 2), 0);
+ // The largest fraction of the omnibox that can be taken by the EV or search
+ // label/chip.
+ const double kLeadingDecorationMaxFraction = 0.5;
location_icon_view_->SetLabel(base::string16());
if (ShouldShowKeywordBubble()) {
- leading_decorations.AddDecoration(vertical_padding, location_height, true,
- 0, item_padding, item_padding,
- selected_keyword_view_);
+ leading_decorations.AddDecoration(
+ vertical_padding, location_height, false, kLeadingDecorationMaxFraction,
+ item_padding, item_padding, selected_keyword_view_);
if (selected_keyword_view_->keyword() != keyword) {
selected_keyword_view_->SetKeyword(keyword);
const TemplateURL* template_url =
@@ -508,11 +511,9 @@ void LocationBarView::Layout() {
}
} else if (ShouldShowLocationIconText()) {
location_icon_view_->SetLabel(GetLocationIconText());
- // The largest fraction of the omnibox that can be taken by the EV bubble.
- const double kMaxBubbleFraction = 0.5;
- leading_decorations.AddDecoration(vertical_padding, location_height, false,
- kMaxBubbleFraction, item_padding,
- item_padding, location_icon_view_);
+ leading_decorations.AddDecoration(
+ vertical_padding, location_height, false, kLeadingDecorationMaxFraction,
+ item_padding, item_padding, location_icon_view_);
} else {
leading_decorations.AddDecoration(vertical_padding, location_height,
location_icon_view_);

Powered by Google App Engine
This is Rietveld 408576698