summaryrefslogtreecommitdiffstats
path: root/chrome/views/table_view.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/views/table_view.cc')
-rw-r--r--chrome/views/table_view.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/views/table_view.cc b/chrome/views/table_view.cc
index a94b9a3..7a00723 100644
--- a/chrome/views/table_view.cc
+++ b/chrome/views/table_view.cc
@@ -504,6 +504,24 @@ bool TableView::HasColumn(int id) {
return all_columns_.count(id) > 0;
}
+gfx::Point TableView::GetKeyboardContextMenuLocation() {
+ int first_selected = FirstSelectedRow();
+ int y = height() / 2;
+ if (first_selected != -1) {
+ RECT cell_bounds;
+ RECT client_rect;
+ if (ListView_GetItemRect(GetNativeControlHWND(), first_selected,
+ &cell_bounds, LVIR_BOUNDS) &&
+ GetClientRect(GetNativeControlHWND(), &client_rect) &&
+ cell_bounds.bottom >= 0 && cell_bounds.bottom < client_rect.bottom) {
+ y = cell_bounds.bottom;
+ }
+ }
+ gfx::Point screen_loc(0, y);
+ ConvertPointToScreen(this, &screen_loc);
+ return screen_loc;
+}
+
void TableView::SetCustomColorsEnabled(bool custom_colors_enabled) {
custom_colors_enabled_ = custom_colors_enabled;
}