Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1102)

Unified Diff: ui/views/touchui/touch_editing_menu.cc

Issue 698253004: Reland: Implement Aura side of unified touch text selection for contents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased after addition of touch_handle_orientation file Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/touchui/touch_editing_menu.cc
diff --git a/ui/views/touchui/touch_editing_menu.cc b/ui/views/touchui/touch_editing_menu.cc
index 7b2c5b61acfc2f7b82a2de626e8b7ab46d5922e8..5ee444388f7b94ccd3970962d657110cac4afd50 100644
--- a/ui/views/touchui/touch_editing_menu.cc
+++ b/ui/views/touchui/touch_editing_menu.cc
@@ -58,6 +58,11 @@ TouchEditingMenuView::TouchEditingMenuView(
// menu is needed to be shown under the selection.
gfx::Rect adjusted_anchor_rect(anchor_rect);
int menu_width = GetPreferredSize().width();
+ // TODO(mfomitchev): This assumes that the handles are center-aligned to the
+ // achor_rect edges, which is not true. We should fix this, perhaps by passing
+ // down the cumulative width occupied by the handles within anchor_rect plus
+ // the handle image height instead of |handle_image_size|. Perhaps we should
+ // also allow for some minimum padding.
if (menu_width > anchor_rect.width() - handle_image_size.width())
adjusted_anchor_rect.Inset(0, 0, 0, -handle_image_size.height());
SetAnchorRect(adjusted_anchor_rect);

Powered by Google App Engine
This is Rietveld 408576698