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

Side by Side Diff: content/browser/renderer_host/text_input_client_message_filter.mm

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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/text_input_client_message_filter.h" 5 #include "content/browser/renderer_host/text_input_client_message_filter.h"
6 6
7 #include "base/strings/string16.h" 7 #include "base/strings/string16.h"
8 #include "content/browser/renderer_host/render_view_host_impl.h" 8 #include "content/browser/renderer_host/render_view_host_impl.h"
9 #include "content/browser/renderer_host/text_input_client_mac.h" 9 #include "content/browser/renderer_host/text_input_client_mac.h"
10 #include "content/common/text_input_client_messages.h" 10 #include "content/common/text_input_client_messages.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 service->SetCharacterIndexAndSignal(index); 58 service->SetCharacterIndexAndSignal(index);
59 } 59 }
60 60
61 void TextInputClientMessageFilter::OnGotFirstRectForRange( 61 void TextInputClientMessageFilter::OnGotFirstRectForRange(
62 const gfx::Rect& rect) { 62 const gfx::Rect& rect) {
63 TextInputClientMac* service = TextInputClientMac::GetInstance(); 63 TextInputClientMac* service = TextInputClientMac::GetInstance();
64 service->SetFirstRectAndSignal(NSRectFromCGRect(rect.ToCGRect())); 64 service->SetFirstRectAndSignal(NSRectFromCGRect(rect.ToCGRect()));
65 } 65 }
66 66
67 void TextInputClientMessageFilter::OnGotStringFromRange( 67 void TextInputClientMessageFilter::OnGotStringFromRange(
68 const mac::AttributedStringCoder::EncodedString& encoded_string) { 68 const mac::AttributedStringCoder::EncodedString& encoded_string,
69 const gfx::Point& point) {
69 TextInputClientMac* service = TextInputClientMac::GetInstance(); 70 TextInputClientMac* service = TextInputClientMac::GetInstance();
70 NSAttributedString* string = 71 NSAttributedString* string =
71 mac::AttributedStringCoder::Decode(&encoded_string); 72 mac::AttributedStringCoder::Decode(&encoded_string);
72 if (![string length]) 73 service->GetStringFromRangeReply(
73 string = nil; 74 string, NSPointFromCGPoint(point.ToCGPoint()));
74 service->SetSubstringAndSignal(string);
75 } 75 }
76 76
77 } // namespace content 77 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/text_input_client_message_filter.h ('k') | content/common/text_input_client_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698