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

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

Issue 15553008: Instant Extended: Reduce clipping in omnibox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
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 0d41fb108a938cb2140730f2ee7025cfd6bb0a2f..c58fc9c2740bacf6b084efdbc3a77786fb7eccff 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
@@ -143,8 +143,7 @@ OmniboxViewMac::OmniboxViewMac(OmniboxEditController* controller,
popup_view_(OmniboxPopupViewMac::Create(this, model(), field)),
field_(field),
delete_was_pressed_(false),
- delete_at_end_pressed_(false),
- line_height_(0) {
+ delete_at_end_pressed_(false) {
[field_ setObserver:this];
// Needed so that editing doesn't lose the styling.
@@ -154,8 +153,6 @@ OmniboxViewMac::OmniboxViewMac(OmniboxEditController* controller,
scoped_nsobject<NSLayoutManager>
layoutManager([[NSLayoutManager alloc] init]);
[layoutManager setUsesScreenFonts:YES];
- line_height_ = [layoutManager defaultLineHeightForFont:GetFieldFont()];
- DCHECK_GT(line_height_, 0);
}
OmniboxViewMac::~OmniboxViewMac() {
@@ -441,8 +438,8 @@ void OmniboxViewMac::ApplyTextAttributes(const string16& display_text,
// otherwise the baseline may shift "downwards".
scoped_nsobject<NSMutableParagraphStyle>
paragraph_style([[NSMutableParagraphStyle alloc] init]);
- [paragraph_style setMaximumLineHeight:line_height_];
- [paragraph_style setMinimumLineHeight:line_height_];
+ [paragraph_style setMaximumLineHeight:[[field_ cell] lineHeight]];
+ [paragraph_style setMinimumLineHeight:[[field_ cell] lineHeight]];
Scott Hess - ex-Googler 2013/05/23 20:08:02 Definitely memoize this, since the compiler cannot
sail 2013/05/23 20:45:44 Done.
[as addAttribute:NSParagraphStyleAttributeName value:paragraph_style
range:as_entire_string];

Powered by Google App Engine
This is Rietveld 408576698