Chromium Code Reviews| 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 0be72e3e604c7e82770552f92430235159e52604..3487dcf201f917e809836bb968fd4614e6c2c9c0 100644 |
| --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| @@ -1250,14 +1250,14 @@ bool LocationBarView::HasFocus() const { |
| void LocationBarView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
| if (browser_ && browser_->instant_controller() && parent()) { |
| - // Pass the side margins of the location bar to the Instant Controller. |
| + // Pass the start margin and width of the location bar to the Instant |
| + // Controller. |
| const gfx::Rect bounds = GetBoundsInScreen(); |
| const gfx::Rect parent_bounds = parent()->GetBoundsInScreen(); |
| - int start = bounds.x() - parent_bounds.x(); |
| - int end = parent_bounds.right() - bounds.right(); |
| - if (base::i18n::IsRTL()) |
| - std::swap(start, end); |
| - browser_->instant_controller()->SetMarginSize(start, end); |
| + const int margin = base::i18n::IsRTL() ? |
| + parent_bounds.right() - bounds.right() : bounds.x() - parent_bounds.x(); |
|
Peter Kasting
2013/02/26 22:07:19
Accessing the parent bounds at all, let alone usin
melevin
2013/02/26 23:43:52
Ah you're right, this code simplified down to just
|
| + const int width = bounds.width(); |
| + browser_->instant_controller()->SetStartMarginAndWidth(margin, width); |
| } |
| } |