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 e8a8d685ae5eb2613dbc020b14434480c4a82601..abe2a88de4902364ec05d5a67e045b2a121d510f 100644 |
| --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| @@ -1275,14 +1275,11 @@ 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. |
| - 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); |
| + // Pass the start margin and width of the location bar to the Instant |
| + // Controller. |
| + const gfx::Rect bounds_rect = bounds(); |
| + browser_->instant_controller()->SetStartMarginAndWidth( |
| + bounds_rect.x(), bounds_rect.width()); |
|
Peter Kasting
2013/02/26 23:46:26
Nit: Rather than using a margin and width pair her
|
| } |
| } |