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

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 asvitkine@'s 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..ef60d90289de938b4640c23e7df1a89204dfaa8d 100644
--- a/content/browser/renderer_host/text_input_client_mac.h
+++ b/content/browser/renderer_host/text_input_client_mac.h
@@ -79,11 +79,25 @@ class CONTENT_EXPORT TextInputClientMac {
// 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
Alexei Svitkine (slow) 2015/09/21 15:47:55 Nit: Add an empty line before this for consistency
Shu Chen 2015/09/22 05:46:08 Done.
// GetStringAtPoint.
void GetStringAtPointReply(NSAttributedString*, NSPoint);
Alexei Svitkine (slow) 2015/09/21 15:47:55 Nit: Can you name these params too?
Shu Chen 2015/09/22 05:46:08 Done.
+ // This async method is invoked from RenderWidgetHostViewMacDictionaryHelper's
+ // ShowDefinitionForSelection().
Alexei Svitkine (slow) 2015/09/21 15:47:55 This comment is referencing code outside content/
Shu Chen 2015/09/22 05:46:08 I don't understand. RenderWidgetHostViewMacDiction
+ // The reply callback will be invoked from the IO thread, the caller is
Alexei Svitkine (slow) 2015/09/21 15:47:56 Nit: , -> ; Also make the same change for the com
Shu Chen 2015/09/22 05:46:08 Done.
+ // 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>;
TextInputClientMac();
@@ -105,7 +119,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