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

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

Issue 2937713002: Fix text alignment issue in Chrome iOS' omnibox. (Closed)
Patch Set: Created 3 years, 6 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 1180cf6b75987b1c03cfa0e5866ef4cccc57d712..ba23da26e3dfb9593e1513a4f62a22e28a8748bf 100644
--- a/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm
+++ b/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm
@@ -284,10 +284,10 @@ NSString* const kOmniboxFadeAnimationKey = @"OmniboxFadeAnimation";
// ends at the same x coord as the blue selection box.
CGSize textSize =
[_preEditStaticLabel.text cr_pixelAlignedSizeWithFont:_font];
- BOOL isLTR = [self bestTextAlignment] == NSTextAlignmentLeft;
+ // Note, this does not need to support RTL, as URLs are always LTR.
return textSize.width < _preEditStaticLabel.frame.size.width
- ? (isLTR ? NSTextAlignmentLeft : NSTextAlignmentRight)
- : (isLTR ? NSTextAlignmentRight : NSTextAlignmentLeft);
+ ? NSTextAlignmentLeft
+ : NSTextAlignmentRight;
}
- (void)layoutSubviews {
« 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