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

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 palmer's comment. 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 4e50eff5c7e39c0fc8e9227154c945ba16aa5bce..e82611f2eb95e41883a200e2eadfe60928a19a9a 100644
--- a/content/browser/renderer_host/text_input_client_mac.h
+++ b/content/browser/renderer_host/text_input_client_mac.h
@@ -81,6 +81,19 @@ class CONTENT_EXPORT TextInputClientMac {
// GetStringAtPoint.
void GetStringAtPointReply(NSAttributedString*, NSPoint);
+ // This async method is invoked from RenderWidgetHostViewMacDictionaryHelper's
+ // ShowDefinitionForSelection().
+ // 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 (^replyHandler)(NSAttributedString*, NSPoint));
Alexei Svitkine (slow) 2015/09/18 16:48:43 replyHandler -> reply_handler
Shu Chen 2015/09/21 02:47:39 Done.
+ // This is called on the IO thread when we get the renderer's reply for
Alexei Svitkine (slow) 2015/09/18 16:48:43 Add an empty line above this.
Shu Chen 2015/09/21 02:47:39 Done.
+ // GetStringFromRange.
+ void GetStringFromRangeReply(NSAttributedString*, NSPoint);
Alexei Svitkine (slow) 2015/09/18 16:48:43 Name the params.
Shu Chen 2015/09/21 02:47:39 Done.
+
private:
friend struct DefaultSingletonTraits<TextInputClientMac>;
TextInputClientMac();
@@ -102,7 +115,10 @@ class CONTENT_EXPORT TextInputClientMac {
base::Lock lock_;
base::ConditionVariable condition_;
- base::mac::ScopedBlock<void(^)(NSAttributedString*, NSPoint)> replyHandler_;
+ base::mac::ScopedBlock<void(^)(NSAttributedString*, NSPoint)>
Alexei Svitkine (slow) 2015/09/18 16:48:43 Add comments.
Shu Chen 2015/09/21 02:47:39 Done.
+ replyForPointHandler_;
+ base::mac::ScopedBlock<void(^)(NSAttributedString*, NSPoint)>
+ replyForRangeHandler_;
DISALLOW_COPY_AND_ASSIGN(TextInputClientMac);
};

Powered by Google App Engine
This is Rietveld 408576698