From 9adf1dcf3281408560267787eddcc767566b425f Mon Sep 17 00:00:00 2001 From: "xji@chromium.org" Date: Fri, 8 May 2009 22:43:37 +0000 Subject: [PATCH] This CL fix issue 9837 - RTL: "Pop-ups blocked" bar should be at left-bottom for RTL Chrome. The fix is to position the 'pop-ups blocked' bar at the bottom left for RTL chrome. Test: 1. Launch Hebrew Chrome 2. load http://www.brg8.com/ 3. Observe the 'pop-up blocked' bar after the page load. Review URL: http://codereview.chromium.org/89004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15691 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/views/blocked_popup_container.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/chrome/browser/views/blocked_popup_container.cc b/chrome/browser/views/blocked_popup_container.cc index 29d1286f829a79..5fcd79247f8dd3 100644 --- a/chrome/browser/views/blocked_popup_container.cc +++ b/chrome/browser/views/blocked_popup_container.cc @@ -542,9 +542,19 @@ void BlockedPopupContainer::SetPosition() { int real_height = static_cast(size.height() * visibility_percentage_); int real_y = anchor_point_.y() - real_height; - // Size this window to the bottom left corner starting at the anchor point. if (real_height > 0) { - SetWindowPos(HWND_TOP, base_x, real_y, size.width(), real_height, 0); + int x; + if (l10n_util::GetTextDirection() == l10n_util::LEFT_TO_RIGHT) { + // Size this window using the anchor point as top-right corner. + x = base_x; + } else { + // Size this window to the bottom left corner of top client window. In + // Chrome, scrollbars always appear on the right, even for a RTL page or + // when the UI is RTL (see http://crbug.com/6113 for more detail). Thus 0 + // is always a safe value for x-axis. + x = 0; + } + SetWindowPos(HWND_TOP, x, real_y, size.width(), real_height, 0); container_view_->SchedulePaint(); } else { SetWindowPos(HWND_TOP, 0, 0, 0, 0,