commit | 3146b3a43b240dcc6d64d5dc6986a311505104e8 | [log] [tgz] |
---|---|---|
author | shuchen <[email protected]> | Tue Sep 22 16:08:24 2015 |
committer | Commit bot <[email protected]> | Tue Sep 22 16:09:09 2015 |
tree | b0a0a83521fc5179f9ac423ea8a74eb943a21207 | |
parent | bcffdcb5dc5b6baa0de7d763ee58d32d4a483b70 [diff] |
Implement "Look Up In Dictionary" context menu item asynchronously. (OS X) Reduces the number of callers of the synchronous IPC in TextInputClientMac::GetAttributedSubstringFromRange() (so that eventually we can remove it). Note: This is the second attempt to commit cl https://codereview.chromium.org/1313553006, which caused regression crbug.com/528929, because the point getten from selection range may not be accurate to get the string through GetStringAtPoint. This cl fixes that issue by leveraging TextInputClientMsg_StringForRange IPCs instead of TextInputClientMsg_StringAtPoint. The change is cross browser & blink so it is 2-way patches. This cl is based on the blink cl https://codereview.chromium.org/1329103002. TextInputClientObserver::OnStringForRange() will send the IPC TextInputClientReplyMsg_GotStringForRange to carry the basepiont info, which is got by the new change in blink. So this cl should be landed after https://codereview.chromium.org/1329103002 is landed. [email protected] BUG=121917 TEST=crbug.com/528929 not repro; Select multiple words and lookup dictionary by context menu can work well; Select non-English words (e.g. Japanese/Chinese) and lookup dictionary by context menu can work well. Review URL: https://codereview.chromium.org/1318483007 Cr-Commit-Position: refs/heads/master@{#350164}