OLD | NEW |
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 Loading... |
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 |
OLD | NEW |