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

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: Fixed test failures on Mac Created 5 years, 8 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..b021aec1ba067d6922082c8f0a2d8b5f157d5a39 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