summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-16 22:28:35 +0000
committerxji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-16 22:28:35 +0000
commitd62bf955b973eeab8b217f46cbcd66768bb9f854 (patch)
treeacead8dba16bd95a42215ef8c3c0026e92cfc4ff
parent69f1be8a969af735b2173349c9bd57a174a9bf16 (diff)
downloadchromium_src-d62bf955b973eeab8b217f46cbcd66768bb9f854.zip
chromium_src-d62bf955b973eeab8b217f46cbcd66768bb9f854.tar.gz
chromium_src-d62bf955b973eeab8b217f46cbcd66768bb9f854.tar.bz2
This CL fixes issue 5729 - RTL: TabStrip context menu should be positioned properly, If window is not maxmized.
(http://crbug.com/5729). The fix is to popup tabstrip context menu from the left of the click in RTL UI. Without the fix, tabstrip context menu always popup from the right of the click. Review URL: http://codereview.chromium.org/73021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13888 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/views/tabs/tab.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/views/tabs/tab.cc b/chrome/browser/views/tabs/tab.cc
index 55f6895..e553cf0 100644
--- a/chrome/browser/views/tabs/tab.cc
+++ b/chrome/browser/views/tabs/tab.cc
@@ -52,8 +52,11 @@ class Tab::ContextMenuController : public views::MenuDelegate {
}
void RunMenuAt(int x, int y) {
+ views::MenuItemView::AnchorPosition anchor =
+ (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) ?
+ views::MenuItemView::TOPRIGHT : views::MenuItemView::TOPLEFT;
menu_->RunMenuAt(tab_->GetWidget()->GetNativeView(), gfx::Rect(x, y, 0, 0),
- views::MenuItemView::TOPLEFT, true);
+ anchor, true);
if (tab_)
tab_->ContextMenuClosed();
delete this;