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

Unified Diff: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm

Issue 7108024: Make selection in omnibox break at periods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
index bb565a35a09adc72e95c7dd96071cdc1f6ff24a1..012a0ebdf85ebb5374fc5bd38cf1afdb513d236b 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
@@ -535,6 +535,11 @@ void OmniboxViewMac::ApplyTextAttributes(const string16& display_text,
[as addAttribute:NSFontAttributeName value:GetFieldFont()
range:NSMakeRange(0, [as length])];
+ // A kinda hacky way to add breaking at periods. This is what Safari does.
+ // This works for IDNs too, despite the "en_US".
+ [as addAttribute:@"NSLanguage" value:@"en_US_POSIX"
+ range:NSMakeRange(0, [as length])];
Mark Mentovai 2011/06/09 14:23:05 Optional: consider computing NSMakeRange(0, [as le
+
// Make a paragraph style locking in the standard line height as the maximum,
// otherwise the baseline may shift "downwards".
scoped_nsobject<NSMutableParagraphStyle>
« 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