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

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..491cc9f534cbc4eb0a25766f2a2be4d0b6ca14e2 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,9 @@ 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_];
+ CGFloat line_height = [[field_ cell] lineHeight];
+ [paragraph_style setMaximumLineHeight:line_height];
+ [paragraph_style setMinimumLineHeight:line_height];
[as addAttribute:NSParagraphStyleAttributeName value:paragraph_style
range:as_entire_string];
« no previous file with comments | « chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h ('k') | chrome/browser/ui/cocoa/styled_text_field_cell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698