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

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

Issue 12047107: Change the SearchBox API from using the start/end margins of the location bar to using the start ma… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: The Great Samarth Merge of 2013 Created 7 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 side-by-side diff with in-line comments
Download patch
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..47ea574f398719d8e1ed3da69f01208679a8e7ae 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);
+ const int margin = base::i18n::IsRTL() ?
+ parent_bounds.right() - bounds.right() : bounds.x() - parent_bounds.x();
+ const int width = bounds.width();
+ browser_->instant_controller()->SetStartMarginAndWidth(margin, width);
}
}

Powered by Google App Engine
This is Rietveld 408576698