Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import "ui/views/cocoa/bridged_content_view.h" | 5 #import "ui/views/cocoa/bridged_content_view.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "base/mac/mac_util.h" | 8 #import "base/mac/mac_util.h" |
| 9 #import "base/mac/scoped_nsobject.h" | 9 #import "base/mac/scoped_nsobject.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1214 } | 1214 } |
| 1215 | 1215 |
| 1216 - (void)setMarkedText:(id)text | 1216 - (void)setMarkedText:(id)text |
| 1217 selectedRange:(NSRange)selectedRange | 1217 selectedRange:(NSRange)selectedRange |
| 1218 replacementRange:(NSRange)replacementRange { | 1218 replacementRange:(NSRange)replacementRange { |
| 1219 if (!textInputClient_) | 1219 if (!textInputClient_) |
| 1220 return; | 1220 return; |
| 1221 | 1221 |
| 1222 if ([text isKindOfClass:[NSAttributedString class]]) | 1222 if ([text isKindOfClass:[NSAttributedString class]]) |
| 1223 text = [text string]; | 1223 text = [text string]; |
| 1224 | |
| 1225 textInputClient_->DeleteRange(gfx::Range(replacementRange)); | |
|
karandeepb
2016/07/26 03:40:52
The only case I have found where a valid replaceme
tapted
2016/07/26 05:40:27
I don't really know IME code paths TBH. One guess:
| |
| 1224 ui::CompositionText composition; | 1226 ui::CompositionText composition; |
| 1225 composition.text = base::SysNSStringToUTF16(text); | 1227 composition.text = base::SysNSStringToUTF16(text); |
| 1226 composition.selection = gfx::Range(selectedRange); | 1228 composition.selection = gfx::Range(selectedRange); |
| 1227 textInputClient_->SetCompositionText(composition); | 1229 textInputClient_->SetCompositionText(composition); |
| 1228 } | 1230 } |
| 1229 | 1231 |
| 1230 - (void)unmarkText { | 1232 - (void)unmarkText { |
| 1231 if (textInputClient_) | 1233 if (textInputClient_) |
| 1232 textInputClient_->ConfirmCompositionText(); | 1234 textInputClient_->ConfirmCompositionText(); |
| 1233 } | 1235 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1288 } | 1290 } |
| 1289 | 1291 |
| 1290 return [super accessibilityAttributeValue:attribute]; | 1292 return [super accessibilityAttributeValue:attribute]; |
| 1291 } | 1293 } |
| 1292 | 1294 |
| 1293 - (id)accessibilityHitTest:(NSPoint)point { | 1295 - (id)accessibilityHitTest:(NSPoint)point { |
| 1294 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; | 1296 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; |
| 1295 } | 1297 } |
| 1296 | 1298 |
| 1297 @end | 1299 @end |
| OLD | NEW |