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

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

Issue 2731113002: Adjust elision of omnibox keyword search label. (Closed)
Patch Set: move helper to mac only code 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 afdd60531b51a05daacb7b3fbf67c330a565f5ed..0887f380b6646ac12e8d1c506045edfd287ea7fc 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -473,12 +473,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 =
@@ -495,11 +498,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