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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_layout.cc

Issue 2710893002: Fix appearance of text in omnibox when no leading decorations are (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/location_bar/location_bar_layout.h" 5 #include "chrome/browser/ui/views/location_bar/location_bar_layout.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "chrome/browser/themes/theme_properties.h" 8 #include "chrome/browser/themes/theme_properties.h"
9 #include "ui/gfx/geometry/rect.h" 9 #include "ui/gfx/geometry/rect.h"
10 #include "ui/views/view.h" 10 #include "ui/views/view.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 first_visible = false; 158 first_visible = false;
159 int x = (position_ == LEFT_EDGE) 159 int x = (position_ == LEFT_EDGE)
160 ? (bounds->x() + padding) 160 ? (bounds->x() + padding)
161 : (bounds->right() - padding - decoration->computed_width); 161 : (bounds->right() - padding - decoration->computed_width);
162 decoration->view->SetBounds(x, decoration->y, decoration->computed_width, 162 decoration->view->SetBounds(x, decoration->y, decoration->computed_width,
163 decoration->height); 163 decoration->height);
164 bounds->set_width(bounds->width() - padding - decoration->computed_width); 164 bounds->set_width(bounds->width() - padding - decoration->computed_width);
165 if (position_ == LEFT_EDGE) 165 if (position_ == LEFT_EDGE)
166 bounds->set_x(bounds->x() + padding + decoration->computed_width); 166 bounds->set_x(bounds->x() + padding + decoration->computed_width);
167 } 167 }
168 bounds->set_width(bounds->width() - item_edit_padding_); 168 // Only apply the edit padding if there's a visible decoration to pad against.
169 if (position_ == LEFT_EDGE) 169 if (!first_visible) {
170 bounds->set_x(bounds->x() + item_edit_padding_); 170 bounds->set_width(bounds->width() - item_edit_padding_);
171 if (position_ == LEFT_EDGE)
172 bounds->set_x(bounds->x() + item_edit_padding_);
173 }
171 } 174 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698