summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-13 01:08:28 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-13 01:08:28 +0000
commit53d2428e2acc99c20c9f9e6b0035f62edb36dc67 (patch)
tree4cf7c3a23db6ab6983da6bb2763776e788e0560c /chrome/browser
parent5f2505cc8dad3469d90c5433c8cc3450b2a8b03e (diff)
downloadchromium_src-53d2428e2acc99c20c9f9e6b0035f62edb36dc67.zip
chromium_src-53d2428e2acc99c20c9f9e6b0035f62edb36dc67.tar.gz
chromium_src-53d2428e2acc99c20c9f9e6b0035f62edb36dc67.tar.bz2
Layout of the Navigation entry's border and its autocomplete popup was broken in RTL.
This fixes the issue. BUG=none TEST=manual: start chromeos build of chrome in RTL. ($LAGNUAGE=he chrome) switch to compact nav bar mode, open main menu and confirm the layout is correct. Review URL: http://codereview.chromium.org/593090 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38991 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/chromeos/main_menu.cc22
1 files changed, 16 insertions, 6 deletions
diff --git a/chrome/browser/chromeos/main_menu.cc b/chrome/browser/chromeos/main_menu.cc
index 3c30f7a..efe724e 100644
--- a/chrome/browser/chromeos/main_menu.cc
+++ b/chrome/browser/chromeos/main_menu.cc
@@ -124,18 +124,28 @@ class NavigationBar : public views::View,
const int padding = kNavigationEntryPadding;
canvas->FillRectInt(SK_ColorWHITE, 0, 0, width(), height());
// Draw border around the entry.
+ gfx::Rect bounds = location_entry_view_->GetBounds(
+ views::View::APPLY_MIRRORING_TRANSFORMATION);
canvas->DrawRectInt(SK_ColorGRAY,
- location_entry_view_->x() - padding,
- location_entry_view_->y() - padding,
- location_entry_view_->width() + padding * 2,
- location_entry_view_->height() + padding * 2);
+ bounds.x() - padding,
+ bounds.y() - padding,
+ bounds.width() + padding * 2,
+ bounds.height() + padding * 2);
}
// BubblePositioner implementation.
virtual gfx::Rect GetLocationStackBounds() const {
- gfx::Point origin(0, height());
+ gfx::Rect bounds = location_entry_view_->GetBounds(
+ views::View::APPLY_MIRRORING_TRANSFORMATION);
+ gfx::Point origin(bounds.x(), bounds.bottom() + kNavigationEntryPadding);
views::View::ConvertPointToScreen(this, &origin);
- return gfx::Rect(origin, gfx::Size(500, 0));
+ gfx::Rect rect = gfx::Rect(origin, gfx::Size(500, 0));
+ if (UILayoutIsRightToLeft()) {
+ // Align the window to the right side of the entry view when
+ // UI is RTL mode.
+ rect.set_x(rect.x() - (rect.width() - location_entry_view_->width()));
+ }
+ return rect;
}
// AutocompleteController implementation.