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

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

Issue 166903005: mac: Add support for asynchronous dictionary lookup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use ScopedBlock. Created 6 years, 9 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 53318f95cb5bb49efe6403fe3bb62a05cbce2538..2c54fce54cd0d0440c7bebe2361dc4596f234302 100644
--- a/content/browser/renderer_host/text_input_client_mac.h
+++ b/content/browser/renderer_host/text_input_client_mac.h
@@ -7,6 +7,7 @@
#import <Cocoa/Cocoa.h>
+#include "base/mac/scoped_block.h"
#include "base/mac/scoped_nsobject.h"
#include "base/synchronization/condition_variable.h"
#include "base/synchronization/lock.h"
@@ -37,6 +38,11 @@ class CONTENT_EXPORT TextInputClientMac {
// Returns the singleton instance.
static TextInputClientMac* GetInstance();
+ void GetStringAtPoint(RenderWidgetHost* rwh,
+ gfx::Point point,
+ void (^replyHandler)(NSAttributedString*, NSPoint));
Avi (use Gerrit) 2014/03/12 04:55:40 Two questions: 1. Is this async, given the callba
Andre 2014/03/12 16:59:26 1. Yes, this is async. Updated comments accordingl
+ void GetStringAtPointReply(NSAttributedString*, NSPoint);
+
// Each of the three methods mentioned above has an associated pair of methods
// to get data from the renderer. The Get*() methods block the calling thread
// (always the UI thread) with a short timeout after the async message has
@@ -82,6 +88,8 @@ class CONTENT_EXPORT TextInputClientMac {
base::Lock lock_;
base::ConditionVariable condition_;
+ base::mac::ScopedBlock<void(^)(NSAttributedString*, NSPoint)> replyHandler_;
+
DISALLOW_COPY_AND_ASSIGN(TextInputClientMac);
};

Powered by Google App Engine
This is Rietveld 408576698