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

Issue 2817673003: Making Mac Dictionary better for OOPIFs and <webview> (Closed)

Created:
3 years, 8 months ago by EhsanK
Modified:
3 years, 8 months ago
CC:
chromium-reviews, creis+watch_chromium.org, yusukes+watch_chromium.org, shuchen+watch_chromium.org, nasko+codewatch_chromium.org, jam, nona+watch_chromium.org, darin-cc_chromium.org, mac-reviews_chromium.org, James Su, site-isolation-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Making Mac Dictionary better for OOPIFs and <webview> There is two ways to invoke Mac dictionary for Chromium: choosing look-up word in context menu for highlighted text, or pressing Ctrl + Command + D. Both methods might involve sending an IPC through TextInputClientMac to the RenderWidget corresponding to the string (i.e., focused RenderWidget or the RenderWidget at the position of mouse cursor). In both cases the IPC comes back with a string and a position with respect to the local roots view port coordinates. The result however is handled on IO thread which leads to complications such as a DCHECK firing (at times) due to accessing the RenderWidgetHostViews weak pointer when getting the focused RenderWidgetHost. Furthermore, word lookup through context menu is broken for <webview>s; both OOPIF-based and BrowserPlugin-based. The former type of <webview>s don't support this feature because RenderWidgetHostViewChildFrame does not implement ShowDefinitionForSelection() method. The latter have regressed after implementing Mac dictionary support for OOPIFs () where the IPC for getting the string from range is only sent to a RenderWidgetHost which is part of the frame tree (which will not be that of a guest represented by a BrowserPlugin). This CL will: 1) Handle dictionary related IPCs on the UI thread to remove the threading issue and make transforming the reported points to root coordinates based on compositor frames and the right OOPIF way (calling RWHV::TransformPointToRooTCoordSpace which can only be done on the UI thread). 2) Implement RenderWidgetHostViewChildFrame::ShowDefinitionForSelection(). 3) Make sure that for BrowserPlugin-based guest the IPC is sent to the RenderWidget of the guest renderer. The CL also adds a test to avoid regressions in word lookup inside guests. TBR=shuchen@chromium.org BUG=643233, 702348, 708183 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2817673003 Cr-Commit-Position: refs/heads/master@{#467149} Committed: https://chromium.googlesource.com/chromium/src/+/67a361af4485aee793aa2ad8dacddd249d19fc1c

Patch Set 1 #

Patch Set 2 : Added the interactive test which now passes both on OOPIF and non-OOPIF webview. #

Total comments: 2

Patch Set 3 : Fixed a comment #

Total comments: 12

Patch Set 4 : Addressing lazyboy@'s comments #

Total comments: 1

Patch Set 5 : Remove ScopedBrowserClient #

Unified diffs Side-by-side diffs Delta from patch set Stats (+118 lines, -41 lines) Patch
M chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc View 1 2 3 4 3 chunks +77 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_widget_host_view_child_frame.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.h View 2 chunks +3 lines, -3 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.mm View 2 chunks +21 lines, -38 lines 0 comments Download
M content/browser/renderer_host/text_input_client_message_filter.h View 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/renderer_host/text_input_client_message_filter.mm View 1 chunk +11 lines, -0 lines 0 comments Download

Messages

Total messages: 42 (28 generated)
EhsanK
Hello Avi, Can you please take a look? Thanks!
3 years, 8 months ago (2017-04-12 18:03:06 UTC) #5
Avi (use Gerrit)
FYI, re "There is two ways to invoke Mac dictionary for Chromium: choosing look-up word ...
3 years, 8 months ago (2017-04-13 14:39:08 UTC) #9
Avi (use Gerrit)
So, to my not-particularly-studied eye, this looks reasonable. But I was looking at the removal ...
3 years, 8 months ago (2017-04-13 14:48:53 UTC) #10
EhsanK
On 2017/04/13 14:39:08, Avi (OOO 10-12 April) wrote: > FYI, re > > "There is ...
3 years, 8 months ago (2017-04-13 14:57:35 UTC) #11
EhsanK
On 2017/04/13 14:48:53, Avi (OOO 10-12 April) wrote: > So, to my not-particularly-studied eye, this ...
3 years, 8 months ago (2017-04-13 15:10:14 UTC) #12
EhsanK
Thanks Avi, Following the comment I am also cc-ing shuchen@ since he worked on removing ...
3 years, 8 months ago (2017-04-13 15:13:07 UTC) #14
Avi (use Gerrit)
On 2017/04/13 15:13:07, EhsanK wrote: > Thanks Avi, > > Following the comment I am ...
3 years, 8 months ago (2017-04-13 15:25:13 UTC) #15
lazyboy
Sending comments for the added test... https://codereview.chromium.org/2817673003/diff/40001/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc File chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc (right): https://codereview.chromium.org/2817673003/diff/40001/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc#newcode1372 chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc:1372: class TestBrowserClient : ...
3 years, 8 months ago (2017-04-13 16:40:45 UTC) #16
EhsanK
Thanks Istiaque! I will wait for reviews and LGTM from shuchen@ as well. PTAL. https://codereview.chromium.org/2817673003/diff/40001/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc ...
3 years, 8 months ago (2017-04-13 17:56:15 UTC) #17
lazyboy
lgtm https://codereview.chromium.org/2817673003/diff/60001/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc File chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc (right): https://codereview.chromium.org/2817673003/diff/60001/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc#newcode1427 chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc:1427: BrowserClientForTextInputClientMac browser_client; optional: You could actually put the ...
3 years, 8 months ago (2017-04-13 18:08:18 UTC) #18
EhsanK
On 2017/04/13 18:08:18, lazyboy wrote: > lgtm > > https://codereview.chromium.org/2817673003/diff/60001/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc > File chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc (right): > ...
3 years, 8 months ago (2017-04-13 20:03:14 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2817673003/80001
3 years, 8 months ago (2017-04-25 22:20:05 UTC) #38
commit-bot: I haz the power
Committed patchset #5 (id:80001) as https://chromium.googlesource.com/chromium/src/+/67a361af4485aee793aa2ad8dacddd249d19fc1c
3 years, 8 months ago (2017-04-25 22:46:02 UTC) #41
Shu Chen
3 years, 8 months ago (2017-04-26 00:31:12 UTC) #42
Message was sent while issue was closed.
lgtm

Powered by Google App Engine
This is Rietveld 408576698