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

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

Issue 1313553006: Implement "Look Up In Dictionary" context menu item asynchronously. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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.mm
diff --git a/content/browser/renderer_host/text_input_client_mac.mm b/content/browser/renderer_host/text_input_client_mac.mm
index 131ab92b1e3fff2bc76da00d982cdc4ca4d9032b..f13e9363395883b2a8758c058551e168adc3438a 100644
--- a/content/browser/renderer_host/text_input_client_mac.mm
+++ b/content/browser/renderer_host/text_input_client_mac.mm
@@ -92,30 +92,6 @@ NSRect TextInputClientMac::GetFirstRectForRange(RenderWidgetHost* rwh,
return first_rect_;
}
-NSAttributedString* TextInputClientMac::GetAttributedSubstringFromRange(
- RenderWidgetHost* rwh,
- NSRange range) {
- base::TimeTicks start = base::TimeTicks::Now();
-
- BeforeRequest();
- RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh);
- rwhi->Send(new TextInputClientMsg_StringForRange(rwhi->GetRoutingID(),
- gfx::Range(range)));
- // http://crbug.com/121917
- base::ThreadRestrictions::ScopedAllowWait allow_wait;
- condition_.TimedWait(base::TimeDelta::FromMilliseconds(kWaitTimeout));
- AfterRequest();
-
- base::TimeDelta delta(base::TimeTicks::Now() - start);
- UMA_HISTOGRAM_LONG_TIMES("TextInputClient.Substring",
- delta * base::Time::kMicrosecondsPerMillisecond);
-
- // Lookup.framework calls this method repeatedly and expects that repeated
- // calls don't deallocate previous results immediately. Returning an
- // autoreleased string is better convention anyway.
- return [[substring_.get() retain] autorelease];
-}
-
void TextInputClientMac::SetCharacterIndexAndSignal(NSUInteger index) {
lock_.Acquire();
character_index_ = index;
@@ -130,13 +106,6 @@ void TextInputClientMac::SetFirstRectAndSignal(NSRect first_rect) {
condition_.Signal();
}
-void TextInputClientMac::SetSubstringAndSignal(NSAttributedString* string) {
- lock_.Acquire();
- substring_.reset([string copy]);
- lock_.Release();
- condition_.Signal();
-}
-
void TextInputClientMac::BeforeRequest() {
base::TimeTicks start = base::TimeTicks::Now();
@@ -148,7 +117,6 @@ void TextInputClientMac::BeforeRequest() {
character_index_ = NSNotFound;
first_rect_ = NSZeroRect;
- substring_.reset();
}
void TextInputClientMac::AfterRequest() {

Powered by Google App Engine
This is Rietveld 408576698