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

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

Issue 10831253: Only compute LocationBarView::AvailableWidth as needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restore max_edit_width naming. Created 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b634b453b545d98cb6bc87daed82e2964409b005..9d5dc7368b2a47a3b8f12a507ed49a342861b2d9 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -692,10 +692,9 @@ void LocationBarView::Layout() {
entry_width -= (total_padding + ev_bubble_width);
}
- int max_edit_width = location_entry_->GetMaxEditWidth(entry_width);
+ const int max_edit_width = location_entry_->GetMaxEditWidth(entry_width);
if (max_edit_width < 0)
return;
- const int available_width = AvailableWidth(max_edit_width);
const bool show_keyword_hint = !keyword.empty() && is_keyword_hint;
selected_keyword_view_->SetVisible(show_selected_keyword);
@@ -811,8 +810,8 @@ void LocationBarView::Layout() {
if (show_selected_keyword) {
selected_keyword_view_->SetBounds(0, location_y + kBubbleVerticalPadding,
0, selected_keyword_view_->GetPreferredSize().height());
- LayoutView(selected_keyword_view_, kItemEditPadding, available_width,
- true, &location_bounds);
+ LayoutView(selected_keyword_view_, kItemEditPadding,
+ AvailableWidth(max_edit_width), true, &location_bounds);
location_bounds.set_x(selected_keyword_view_->visible() ?
(offset + selected_keyword_view_->width() + kItemEditPadding) :
(kEdgeThickness + kEdgeEditPadding));
@@ -823,8 +822,8 @@ void LocationBarView::Layout() {
// its left. So we undo the enlargement, then include it in the padding for
// the added view.
location_bounds.Inset(0, 0, kEditInternalSpace, 0);
- LayoutView(keyword_hint_view_, kItemEditPadding, available_width, false,
- &location_bounds);
+ LayoutView(keyword_hint_view_, kItemEditPadding,
+ AvailableWidth(max_edit_width), false, &location_bounds);
if (!keyword_hint_view_->visible()) {
// Put back the enlargement that we undid above.
location_bounds.Inset(0, 0, -kEditInternalSpace, 0);
« 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