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 76f08525e6307eebd78f3774533db4a578360638..e08d70c5ff8d9afc511995695582150e6bf49ab3 100644 |
| --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| @@ -1286,14 +1286,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); |
| + int margin = base::i18n::IsRTL() ? |
|
samarth
2013/02/05 23:39:33
nit: const int (and below)
melevin
2013/02/06 23:44:05
Done.
|
| + parent_bounds.right() - bounds.right() : bounds.x() - parent_bounds.x(); |
| + int width = bounds.width(); |
| + browser_->instant_controller()->SetLocationBarMarginAndWidth(margin, width); |
| } |
| } |