| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 } | 81 } |
| 82 return false; | 82 return false; |
| 83 } | 83 } |
| 84 | 84 |
| 85 // Returns true if |client| has RTL text. | 85 // Returns true if |client| has RTL text. |
| 86 bool IsTextRTL(const ui::TextInputClient* client) { | 86 bool IsTextRTL(const ui::TextInputClient* client) { |
| 87 gfx::Range text_range; | 87 gfx::Range text_range; |
| 88 base::string16 text; | 88 base::string16 text; |
| 89 return client && client->GetTextRange(&text_range) && | 89 return client && client->GetTextRange(&text_range) && |
| 90 client->GetTextFromRange(text_range, &text) && | 90 client->GetTextFromRange(text_range, &text) && |
| 91 base::i18n::GetStringDirection(text) == base::i18n::RIGHT_TO_LEFT; | 91 base::i18n::GetFirstStrongCharacterDirection(text) == |
| 92 base::i18n::RIGHT_TO_LEFT; |
| 92 } | 93 } |
| 93 | 94 |
| 94 // Returns the boundary rectangle for composition characters in the | 95 // Returns the boundary rectangle for composition characters in the |
| 95 // |requested_range|. Sets |actual_range| corresponding to the returned | 96 // |requested_range|. Sets |actual_range| corresponding to the returned |
| 96 // rectangle. For cases, where there is no composition text or the | 97 // rectangle. For cases, where there is no composition text or the |
| 97 // |requested_range| lies outside the composition range, a zero width rectangle | 98 // |requested_range| lies outside the composition range, a zero width rectangle |
| 98 // corresponding to the caret bounds is returned. Logic used is similar to | 99 // corresponding to the caret bounds is returned. Logic used is similar to |
| 99 // RenderWidgetHostViewMac::GetCachedFirstRectForCharacterRange(...). | 100 // RenderWidgetHostViewMac::GetCachedFirstRectForCharacterRange(...). |
| 100 gfx::Rect GetFirstRectForRangeHelper(const ui::TextInputClient* client, | 101 gfx::Rect GetFirstRectForRangeHelper(const ui::TextInputClient* client, |
| 101 const gfx::Range& requested_range, | 102 const gfx::Range& requested_range, |
| (...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1232 } | 1233 } |
| 1233 | 1234 |
| 1234 return [super accessibilityAttributeValue:attribute]; | 1235 return [super accessibilityAttributeValue:attribute]; |
| 1235 } | 1236 } |
| 1236 | 1237 |
| 1237 - (id)accessibilityHitTest:(NSPoint)point { | 1238 - (id)accessibilityHitTest:(NSPoint)point { |
| 1238 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; | 1239 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; |
| 1239 } | 1240 } |
| 1240 | 1241 |
| 1241 @end | 1242 @end |
| OLD | NEW |