Updates: Cc: dmacl...@chromium.org Comment #6 on issue 17951 by tha...@chromium.org: cmd-ctrl-d should show dictionary entry of currently highlighted word http://code.google.com/p/chromium/issues/detail?id=17951
scherkus: Cool :-) I did some digging, just for you. If you hit cmd-ctrl-d in a current ToT build, you get a NOTIMPLEMENTED in render_widget_host_view_mac.mm, method characterIndexForPoint:. dtrace tells us who calls that: ~/src/chrome-git/src thakis$ sudo dtrace -n 'objc$target::-characterIndexForPoint?:entry { ustack(); }' -p 16519 dtrace: description 'objc$target::-characterIndexForPoint?:entry ' matched 4 probes CPU ID FUNCTION:NAME 1 25654 -characterIndexForPoint::entry AppKit`-[NSInputContext characterIndexForPoint:] AppKit`_NSTSMEventHandler+0x1703 HIToolbox`DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*)+0x49d HIToolbox`SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*)+0x195 HIToolbox`SendEventToEventTarget+0x34 HIToolbox`SendTSMEvent+0xf7 HIToolbox`SendTextInputEvent+0xad1 DictionaryService`DSGetTextUnderMouse+0x11a DictionaryService`DSInitializeMessageReceiving+0x2d0 CoreFoundation`__CFMessagePortPerform+0xc1 CoreFoundation`CFRunLoopRunSpecific+0xf38 CoreFoundation`CFRunLoopRunInMode+0x58 HIToolbox`RunCurrentEventLoopInMode+0x11b HIToolbox`ReceiveNextEventCommon+0x176 HIToolbox`BlockUntilNextEventMatchingListInMode+0x6a AppKit`_DPSNextEvent+0x291 AppKit`-[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]+0x80 AppKit`-[NSApplication run]+0x31b Google Chrome Framework`ChromeMain+0x495013 Google Chrome Framework`ChromeMain+0x4950f6 Googling for DSGetTextUnderMouse() suggests that DictionaryService tries to get the actual text under the cursor using the accessibility system APIs ("DSAXGetTextUnderMouse"). So it looks like dictionary's logic goes like: 1.) Get index of character below cursor using characterIndexForPoint: 2.) Use the accessibility APIs to get the text at that index 3.) Display the window you want so badly To make this work, you have to plumb the coordinate->index transformation through IPC to make 1 work and then probably implement enough of the accessibility stuff to make 2. work (this would be a good thing either way). cc'ing dmac cause he seems to have some experience with AX stuff. Maybe he can comment on your next steps once you're done with 1. :-) -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings --~--~---------~--~----~------------~-------~--~----~ Automated mail from issue updates at http://crbug.com/ Subscription options: http://groups.google.com/group/chromium-bugs -~----------~----~----~----~------~----~------~--~---