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

Issue 700563002: Implementing directional text selection handles (Closed)

Created:
6 years, 1 month ago by mfomitchev
Modified:
6 years, 1 month ago
Reviewers:
Charlie Reis, mohsen, sky
CC:
chromium-reviews, tdanderson+views_chromium.org, yusukes+watch_chromium.org, yukishiino+watch_chromium.org, tfarina, jam, penghuang+watch_chromium.org, sievers+watch_chromium.org, jbauman+watch_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, oshima+watch_chromium.org, kalyank, piman+watch_chromium.org, danakj+watch_chromium.org, James Su
Base URL:
https://chromium.googlesource.com/chromium/src.git@new_assets_text
Project:
chromium
Visibility:
Public.

Description

This change implements support for directional selection handles, i.e. handles that look differently depending if they are located at the left or right edge of the selection, or at the cursor. For web contents, the type of the handle is determined based on the information passed up from Blink in ViewHostMsg_SelectionBounds_Params. For Aura Textfield, it is calculated directly. New image assets (submitted in https://codereview.chromium.org/694873002) are used. New struct ui::SelectionBound is introduced to encapsulate the information about a selection bound. This struct is purposefully made similar to cc::ViewportSelectionBound which is used by TouchSelectionController, and which we'll likely be using for RenderWidgetHostViewAura once we switch to the unified touch selection implementation between Android and Aura. Depends on: https://codereview.chromium.org/686513004/ https://codereview.chromium.org/694873002/ BUG=398053, 419898 Committed: https://crrev.com/218e811496df0cd6660d2f86e13ca04d10d5ef4f Cr-Commit-Position: refs/heads/master@{#304524}

Patch Set 1 #

Total comments: 43

Patch Set 2 : Addressing review feedback. #

Total comments: 28

Patch Set 3 : Addressing feedback (contd) plus Rebase #

Total comments: 4

Patch Set 4 : Some test cleanup #

Total comments: 14

Patch Set 5 : Addressing sky's feedback. #

Patch Set 6 : ' -> " in BUILD.gn #

Patch Set 7 : Removing XOR #

Patch Set 8 : Removing the SelectionBound test from Android, since touch_editing_controller not included in Andro… #

Unified diffs Side-by-side diffs Delta from patch set Stats (+847 lines, -379 lines) Patch
M content/browser/renderer_host/render_widget_host_view_aura.h View 2 3 chunks +7 lines, -5 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.cc View 1 2 3 4 5 6 3 chunks +37 lines, -11 lines 0 comments Download
M content/browser/web_contents/touch_editable_impl_aura.h View 3 chunks +7 lines, -6 lines 0 comments Download
M content/browser/web_contents/touch_editable_impl_aura.cc View 5 chunks +15 lines, -18 lines 0 comments Download
M content/browser/web_contents/touch_editable_impl_aura_browsertest.cc View 1 6 chunks +20 lines, -7 lines 0 comments Download
M ui/base/BUILD.gn View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M ui/base/touch/touch_editing_controller.h View 1 2 3 4 3 chunks +39 lines, -8 lines 0 comments Download
M ui/base/touch/touch_editing_controller.cc View 1 2 3 4 1 chunk +39 lines, -0 lines 0 comments Download
A ui/base/touch/touch_editing_controller_unittest.cc View 1 2 3 4 1 chunk +99 lines, -0 lines 0 comments Download
M ui/base/ui_base_tests.gypi View 1 2 3 4 5 6 7 2 chunks +4 lines, -0 lines 0 comments Download
D ui/resources/default_100_percent/common/text_selection_handle_small.png View Binary file 0 comments Download
D ui/resources/default_200_percent/common/text_selection_handle_small.png View Binary file 0 comments Download
M ui/resources/ui_resources.grd View 2 1 chunk +3 lines, -1 line 0 comments Download
M ui/views/controls/textfield/textfield.h View 1 chunk +2 lines, -1 line 0 comments Download
M ui/views/controls/textfield/textfield.cc View 1 2 3 4 5 6 1 chunk +27 lines, -3 lines 0 comments Download
M ui/views/controls/textfield/textfield_unittest.cc View 1 2 3 4 3 chunks +10 lines, -0 lines 0 comments Download
M ui/views/touchui/touch_selection_controller_impl.h View 1 3 chunks +27 lines, -20 lines 0 comments Download
M ui/views/touchui/touch_selection_controller_impl.cc View 1 2 21 chunks +298 lines, -156 lines 0 comments Download
M ui/views/touchui/touch_selection_controller_impl_unittest.cc View 1 2 3 4 21 chunks +204 lines, -143 lines 0 comments Download
M ui/views/widget/widget_interactive_uitest.cc View 1 2 3 4 4 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 35 (9 generated)
mfomitchev
6 years, 1 month ago (2014-11-03 17:34:26 UTC) #2
sadrul
Can you add some details about the change in the CL description?
6 years, 1 month ago (2014-11-03 17:56:26 UTC) #3
mfomitchev
Done
6 years, 1 month ago (2014-11-03 18:11:25 UTC) #4
mohsen
https://codereview.chromium.org/700563002/diff/1/content/browser/renderer_host/render_widget_host_view_aura.cc File content/browser/renderer_host/render_widget_host_view_aura.cc (right): https://codereview.chromium.org/700563002/diff/1/content/browser/renderer_host/render_widget_host_view_aura.cc#newcode934 content/browser/renderer_host/render_widget_host_view_aura.cc:934: gfx::Rect focus_rect(params.focus_rect); I think the above copies are not ...
6 years, 1 month ago (2014-11-07 16:52:27 UTC) #5
mfomitchev
Mohsen, can you please take another look? Thanks! https://codereview.chromium.org/700563002/diff/1/content/browser/renderer_host/render_widget_host_view_aura.cc File content/browser/renderer_host/render_widget_host_view_aura.cc (right): https://codereview.chromium.org/700563002/diff/1/content/browser/renderer_host/render_widget_host_view_aura.cc#newcode934 content/browser/renderer_host/render_widget_host_view_aura.cc:934: gfx::Rect ...
6 years, 1 month ago (2014-11-10 04:04:13 UTC) #6
mohsen
https://codereview.chromium.org/700563002/diff/1/ui/views/touchui/touch_selection_controller_impl.cc File ui/views/touchui/touch_selection_controller_impl.cc (right): https://codereview.chromium.org/700563002/diff/1/ui/views/touchui/touch_selection_controller_impl.cc#newcode117 ui/views/touchui/touch_selection_controller_impl.cc:117: enum Alignment {ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT}; On 2014/11/10 04:04:12, mfomitchev ...
6 years, 1 month ago (2014-11-10 22:26:00 UTC) #7
mfomitchev
https://codereview.chromium.org/700563002/diff/1/ui/views/touchui/touch_selection_controller_impl.cc File ui/views/touchui/touch_selection_controller_impl.cc (right): https://codereview.chromium.org/700563002/diff/1/ui/views/touchui/touch_selection_controller_impl.cc#newcode117 ui/views/touchui/touch_selection_controller_impl.cc:117: enum Alignment {ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT}; GetCursorAlignment is used twice, ...
6 years, 1 month ago (2014-11-10 23:07:30 UTC) #8
mohsen
https://codereview.chromium.org/700563002/diff/20001/ui/base/touch/touch_editing_controller.cc File ui/base/touch/touch_editing_controller.cc (right): https://codereview.chromium.org/700563002/diff/20001/ui/base/touch/touch_editing_controller.cc#newcode37 ui/base/touch/touch_editing_controller.cc:37: return gfx::UnionRects(rect_1, rect_2); On 2014/11/10 23:07:29, mfomitchev wrote: > ...
6 years, 1 month ago (2014-11-11 01:24:39 UTC) #9
mfomitchev
https://codereview.chromium.org/700563002/diff/20001/content/browser/renderer_host/render_widget_host_view_aura.cc File content/browser/renderer_host/render_widget_host_view_aura.cc (right): https://codereview.chromium.org/700563002/diff/20001/content/browser/renderer_host/render_widget_host_view_aura.cc#newcode963 content/browser/renderer_host/render_widget_host_view_aura.cc:963: anchor_bound, focus_bound); On 2014/11/10 22:25:59, mohsen wrote: > nit: ...
6 years, 1 month ago (2014-11-12 18:32:49 UTC) #10
mohsen
https://codereview.chromium.org/700563002/diff/40001/ui/views/touchui/touch_selection_controller_impl_unittest.cc File ui/views/touchui/touch_selection_controller_impl_unittest.cc (right): https://codereview.chromium.org/700563002/diff/40001/ui/views/touchui/touch_selection_controller_impl_unittest.cc#newcode166 ui/views/touchui/touch_selection_controller_impl_unittest.cc:166: test_cursor_client_->EnableMouseEvents(); Can you use EventGenerator here? https://codereview.chromium.org/700563002/diff/40001/ui/views/touchui/touch_selection_controller_impl_unittest.cc#newcode210 ui/views/touchui/touch_selection_controller_impl_unittest.cc:210: point.Offset(rect.width() ...
6 years, 1 month ago (2014-11-12 21:41:46 UTC) #11
mfomitchev
https://codereview.chromium.org/700563002/diff/40001/ui/views/touchui/touch_selection_controller_impl_unittest.cc File ui/views/touchui/touch_selection_controller_impl_unittest.cc (right): https://codereview.chromium.org/700563002/diff/40001/ui/views/touchui/touch_selection_controller_impl_unittest.cc#newcode166 ui/views/touchui/touch_selection_controller_impl_unittest.cc:166: test_cursor_client_->EnableMouseEvents(); There are complications with this like configuring the ...
6 years, 1 month ago (2014-11-13 22:11:48 UTC) #12
mohsen
LGTM https://codereview.chromium.org/700563002/diff/1/ui/views/touchui/touch_selection_controller_impl.cc File ui/views/touchui/touch_selection_controller_impl.cc (right): https://codereview.chromium.org/700563002/diff/1/ui/views/touchui/touch_selection_controller_impl.cc#newcode117 ui/views/touchui/touch_selection_controller_impl.cc:117: enum Alignment {ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT}; On 2014/11/10 23:07:29, ...
6 years, 1 month ago (2014-11-13 22:59:57 UTC) #13
mfomitchev
+sky for owner review
6 years, 1 month ago (2014-11-13 23:36:47 UTC) #16
mfomitchev
https://codereview.chromium.org/700563002/diff/1/ui/views/touchui/touch_selection_controller_impl.cc File ui/views/touchui/touch_selection_controller_impl.cc (right): https://codereview.chromium.org/700563002/diff/1/ui/views/touchui/touch_selection_controller_impl.cc#newcode117 ui/views/touchui/touch_selection_controller_impl.cc:117: enum Alignment {ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT}; On 2014/11/13 22:59:56, mohsen ...
6 years, 1 month ago (2014-11-13 23:49:51 UTC) #17
sky
I didn't look at ui/views/touchui. I'm assuming mohsen did. Can you add mohsen to ui/views/touchui/OWNERS? ...
6 years, 1 month ago (2014-11-14 02:02:47 UTC) #18
mfomitchev
https://codereview.chromium.org/700563002/diff/60001/ui/base/touch/touch_editing_controller.cc File ui/base/touch/touch_editing_controller.cc (right): https://codereview.chromium.org/700563002/diff/60001/ui/base/touch/touch_editing_controller.cc#newcode41 ui/base/touch/touch_editing_controller.cc:41: const int num_elements = 4; On 2014/11/14 02:02:47, sky ...
6 years, 1 month ago (2014-11-14 19:56:27 UTC) #19
mfomitchev
+sadrul for changes content/browser
6 years, 1 month ago (2014-11-14 19:59:17 UTC) #21
sky
LGTM https://codereview.chromium.org/700563002/diff/60001/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/700563002/diff/60001/ui/views/controls/textfield/textfield.cc#newcode1127 ui/views/controls/textfield/textfield.cc:1127: } else if (ltr ^ (range_start < range_end)) ...
6 years, 1 month ago (2014-11-14 20:30:57 UTC) #22
mfomitchev
https://codereview.chromium.org/700563002/diff/60001/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/700563002/diff/60001/ui/views/controls/textfield/textfield.cc#newcode1127 ui/views/controls/textfield/textfield.cc:1127: } else if (ltr ^ (range_start < range_end)) { ...
6 years, 1 month ago (2014-11-14 20:46:04 UTC) #23
mfomitchev
+creis@chromium.org: Please review changes in content/browser
6 years, 1 month ago (2014-11-17 20:03:43 UTC) #26
Charlie Reis
content/browser LGTM
6 years, 1 month ago (2014-11-17 21:19:08 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/700563002/120001
6 years, 1 month ago (2014-11-17 21:39:37 UTC) #29
commit-bot: I haz the power
Try jobs failed on following builders: android_dbg_tests_recipe on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_dbg_tests_recipe/builds/29067)
6 years, 1 month ago (2014-11-17 21:59:34 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/700563002/140001
6 years, 1 month ago (2014-11-17 22:29:30 UTC) #33
commit-bot: I haz the power
Committed patchset #8 (id:140001)
6 years, 1 month ago (2014-11-18 00:13:59 UTC) #34
commit-bot: I haz the power
6 years, 1 month ago (2014-11-18 00:14:47 UTC) #35
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/218e811496df0cd6660d2f86e13ca04d10d5ef4f
Cr-Commit-Position: refs/heads/master@{#304524}

Powered by Google App Engine
This is Rietveld 408576698