Index: content/browser/renderer_host/render_widget_host_view_mac.mm |
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm |
index 6c5e8f88928c4ffde982d35d4084c548ff99a53c..75edded0f5421b6e73e4bbdc4157d57305bb29dd 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm |
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm |
@@ -2471,15 +2471,15 @@ extern NSString *NSTextInputReplacementRangeAttributeName; |
// events, such as the Characters dialog. In this case the text should be |
// sent as an input method event as well. |
// TODO(suzhe): It's hard for us to support replacementRange without accessing |
Avi (use Gerrit)
2011/10/12 00:22:09
Is this comment meaningful?
Nico
2011/10/12 00:23:18
I don't know what it means. Maybe it makes sense f
Avi (use Gerrit)
2011/10/12 00:29:27
Well, this patch _does_ implement replacementRange
Nico
2011/10/12 00:34:30
Only in the IME case, though.
|
- // the full web content. NOTE: If someone adds support for this, make sure |
- // it works with the default range passed in by -insertText: below. |
+ // the full web content. |
BOOL isAttributedString = [string isKindOfClass:[NSAttributedString class]]; |
NSString* im_text = isAttributedString ? [string string] : string; |
if (handlingKeyDown_) { |
textToBeInserted_.append(base::SysNSStringToUTF16(im_text)); |
} else { |
+ ui::Range replacement_range(replacementRange); |
renderWidgetHostView_->render_widget_host_->ImeConfirmComposition( |
- base::SysNSStringToUTF16(im_text)); |
+ base::SysNSStringToUTF16(im_text), replacement_range); |
} |
// Inserting text will delete all marked text automatically. |
@@ -2489,7 +2489,7 @@ extern NSString *NSTextInputReplacementRangeAttributeName; |
- (void)insertText:(id)string { |
// This is a method on NSTextInput, not NSTextInputClient. But on 10.5, this |
// gets called anyway. Forward to the right method. http://crbug.com/47890 |
- [self insertText:string replacementRange:NSMakeRange(0, 0)]; |
+ [self insertText:string replacementRange:NSMakeRange(NSNotFound, 0)]; |
} |
- (void)viewDidMoveToWindow { |