diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-25 21:29:45 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-25 21:29:45 +0000 |
commit | 39ee8f7a3096c37b18fa65047b88643b376f1cc3 (patch) | |
tree | e5fb2f163332a11cb7a936c11ddbc9fecea9710d /chrome/views/table_view.cc | |
parent | 86baff29bae1a00012aad5f360b75c2066abc8f4 (diff) | |
download | chromium_src-39ee8f7a3096c37b18fa65047b88643b376f1cc3.zip chromium_src-39ee8f7a3096c37b18fa65047b88643b376f1cc3.tar.gz chromium_src-39ee8f7a3096c37b18fa65047b88643b376f1cc3.tar.bz2 |
Changes table_view to get position for context menu from the current
position of the mose. I've no idea why, but it seems when RTL the
position passed to OnContextMenu is wrong in weird inconsistent
ways. I thought it was interted, but that isn't always the case. I'm
also changing the anchor position to top_right when RTL.
BUG=4750
TEST=see bug
Review URL: http://codereview.chromium.org/12447
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5996 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/table_view.cc')
-rw-r--r-- | chrome/views/table_view.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/views/table_view.cc b/chrome/views/table_view.cc index 61d70388..208a38b 100644 --- a/chrome/views/table_view.cc +++ b/chrome/views/table_view.cc @@ -1076,6 +1076,21 @@ void TableView::OnDestroy() { } } +void TableView::OnContextMenu(const CPoint& location) { + if (!GetContextMenuController()) + return; + + if (!UILayoutIsRightToLeft() || (location.x == -1 && location.y == -1)) { + NativeControl::OnContextMenu(location); + return; + } + // For some reason context menu gestures when rtl have the wrong coordinates; + // get the position of the cursor and use it. + CPoint cursor_point; + GetCursorPos(&cursor_point); + NativeControl::OnContextMenu(cursor_point); +} + // Returns result, unless ascending is false in which case -result is returned. static int SwapCompareResult(int result, bool ascending) { return ascending ? result : -result; |