Index: content/browser/renderer_host/text_input_client_mac.mm |
diff --git a/content/browser/renderer_host/text_input_client_mac.mm b/content/browser/renderer_host/text_input_client_mac.mm |
index b9d900a704ea47ca047bce8d9220ab57c744eaf7..6bccccf07d0227c2b999ccbac011ee47cae847be 100644 |
--- a/content/browser/renderer_host/text_input_client_mac.mm |
+++ b/content/browser/renderer_host/text_input_client_mac.mm |
@@ -33,6 +33,23 @@ TextInputClientMac* TextInputClientMac::GetInstance() { |
return Singleton<TextInputClientMac>::get(); |
} |
+void TextInputClientMac::GetStringAtPoint( |
+ RenderWidgetHost* rwh, |
+ gfx::Point point, |
+ void (^replyHandler)(NSAttributedString*, NSPoint)) { |
+ replyHandler_.reset(replyHandler, base::scoped_policy::RETAIN); |
Avi (use Gerrit)
2014/03/12 04:55:40
Out of paranoia, DCHECK if the replyHandler_ isn't
Andre
2014/03/12 16:59:26
Done.
|
+ RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); |
+ rwhi->Send(new TextInputClientMsg_StringAtPoint(rwhi->GetRoutingID(), point)); |
+} |
+ |
+void TextInputClientMac::GetStringAtPointReply(NSAttributedString* string, |
+ NSPoint point) { |
Avi (use Gerrit)
2014/03/12 04:55:40
Isn't this guaranteed to be on the main thread?
Andre
2014/03/12 16:59:26
No, this happens on the IO thread.
|
+ if (replyHandler_.get()) { |
+ replyHandler_.get()(string, point); |
+ replyHandler_.reset(); |
+ } |
+} |
+ |
NSUInteger TextInputClientMac::GetCharacterIndexAtPoint(RenderWidgetHost* rwh, |
gfx::Point point) { |
base::TimeTicks start = base::TimeTicks::Now(); |