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

Unified Diff: content/browser/renderer_host/text_input_client_mac.h

Issue 1318483007: Implement "Look Up In Dictionary" context menu item asynchronously. (OS X) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed review comments. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/text_input_client_mac.h
diff --git a/content/browser/renderer_host/text_input_client_mac.h b/content/browser/renderer_host/text_input_client_mac.h
index d682ebdf60e6ae1eabd7084680de97b7d27aeba3..02d6014202675ffebc53944cc333144393a026fd 100644
--- a/content/browser/renderer_host/text_input_client_mac.h
+++ b/content/browser/renderer_host/text_input_client_mac.h
@@ -73,16 +73,31 @@ class CONTENT_EXPORT TextInputClientMac {
// This async method is invoked from RenderWidgetHostViewCocoa's
// -quickLookWithEvent:, when the user taps a word using 3 fingers.
- // The reply callback will be invoked from the IO thread, the caller is
+ // The reply callback will be invoked from the IO thread; the caller is
// responsible for bouncing to the main thread if necessary.
// The callback parameters provide the attributed word under the point and
// the lower left baseline point of the text.
void GetStringAtPoint(RenderWidgetHost* rwh,
gfx::Point point,
- void (^replyHandler)(NSAttributedString*, NSPoint));
+ void (^reply_handler)(NSAttributedString*, NSPoint));
+
// This is called on the IO thread when we get the renderer's reply for
// GetStringAtPoint.
- void GetStringAtPointReply(NSAttributedString*, NSPoint);
+ void GetStringAtPointReply(NSAttributedString* string, NSPoint point);
+
+ // This async method is invoked when browser tries to retreive the text for
+ // certain range and doesn't want to wait for the reply from blink.
+ // The reply callback will be invoked from the IO thread; the caller is
+ // responsible for bouncing to the main thread if necessary.
+ // The callback parameters provide the attributed word under the point and
+ // the lower left baseline point of the text.
+ void GetStringFromRange(RenderWidgetHost* rwh,
+ NSRange range,
+ void (^reply_handler)(NSAttributedString*, NSPoint));
+
+ // This is called on the IO thread when we get the renderer's reply for
+ // GetStringFromRange.
+ void GetStringFromRangeReply(NSAttributedString* string, NSPoint point);
private:
friend struct base::DefaultSingletonTraits<TextInputClientMac>;
@@ -105,7 +120,13 @@ class CONTENT_EXPORT TextInputClientMac {
base::Lock lock_;
base::ConditionVariable condition_;
- base::mac::ScopedBlock<void(^)(NSAttributedString*, NSPoint)> replyHandler_;
+ // The callback when received IPC TextInputClientReplyMsg_GotStringAtPoint.
+ base::mac::ScopedBlock<void(^)(NSAttributedString*, NSPoint)>
+ replyForPointHandler_;
+
+ // The callback when received IPC TextInputClientReplyMsg_GotStringForRange.
+ base::mac::ScopedBlock<void(^)(NSAttributedString*, NSPoint)>
+ replyForRangeHandler_;
DISALLOW_COPY_AND_ASSIGN(TextInputClientMac);
};

Powered by Google App Engine
This is Rietveld 408576698