| 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 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 } | 1207 } |
| 1208 | 1208 |
| 1209 - (void)setMarkedText:(id)text | 1209 - (void)setMarkedText:(id)text |
| 1210 selectedRange:(NSRange)selectedRange | 1210 selectedRange:(NSRange)selectedRange |
| 1211 replacementRange:(NSRange)replacementRange { | 1211 replacementRange:(NSRange)replacementRange { |
| 1212 if (!textInputClient_) | 1212 if (!textInputClient_) |
| 1213 return; | 1213 return; |
| 1214 | 1214 |
| 1215 if ([text isKindOfClass:[NSAttributedString class]]) | 1215 if ([text isKindOfClass:[NSAttributedString class]]) |
| 1216 text = [text string]; | 1216 text = [text string]; |
| 1217 |
| 1218 textInputClient_->DeleteRange(gfx::Range(replacementRange)); |
| 1217 ui::CompositionText composition; | 1219 ui::CompositionText composition; |
| 1218 composition.text = base::SysNSStringToUTF16(text); | 1220 composition.text = base::SysNSStringToUTF16(text); |
| 1219 composition.selection = gfx::Range(selectedRange); | 1221 composition.selection = gfx::Range(selectedRange); |
| 1220 textInputClient_->SetCompositionText(composition); | 1222 textInputClient_->SetCompositionText(composition); |
| 1221 } | 1223 } |
| 1222 | 1224 |
| 1223 - (void)unmarkText { | 1225 - (void)unmarkText { |
| 1224 if (textInputClient_) | 1226 if (textInputClient_) |
| 1225 textInputClient_->ConfirmCompositionText(); | 1227 textInputClient_->ConfirmCompositionText(); |
| 1226 } | 1228 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1281 } | 1283 } |
| 1282 | 1284 |
| 1283 return [super accessibilityAttributeValue:attribute]; | 1285 return [super accessibilityAttributeValue:attribute]; |
| 1284 } | 1286 } |
| 1285 | 1287 |
| 1286 - (id)accessibilityHitTest:(NSPoint)point { | 1288 - (id)accessibilityHitTest:(NSPoint)point { |
| 1287 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; | 1289 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; |
| 1288 } | 1290 } |
| 1289 | 1291 |
| 1290 @end | 1292 @end |
| OLD | NEW |