Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm

Issue 2831193004: Fix text alignment issue in Chrome iOS' omnibox. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm b/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm
index 64020a711201f11c6d7ae81db8e1fc1865d881df..fa657bb2b238adea142bbbfbdac766949bd4b19e 100644
--- a/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm
+++ b/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm
@@ -273,10 +273,14 @@ NSString* const kOmniboxFadeAnimationKey = @"OmniboxFadeAnimation";
}
- (NSTextAlignment)bestTextAlignment {
+ NSTextAlignment alignment;
if ([self isFirstResponder]) {
- return [self bestAlignmentForText:[self text]];
+ alignment = [self bestAlignmentForText:[self text]];
+ } else {
+ alignment = UseRTLLayout() ? NSTextAlignmentRight : NSTextAlignmentLeft;
}
- return NSTextAlignmentNatural;
+ DCHECK(alignment == NSTextAlignmentLeft || alignment == NSTextAlignmentRight);
+ return alignment;
}
- (NSTextAlignment)preEditTextAlignment {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698