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

Unified Diff: chrome/browser/ui/cocoa/styled_text_field_cell.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
« no previous file with comments | « chrome/browser/ui/cocoa/styled_text_field_cell.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/styled_text_field_cell.mm
diff --git a/chrome/browser/ui/cocoa/styled_text_field_cell.mm b/chrome/browser/ui/cocoa/styled_text_field_cell.mm
index 4cf3f707e81e61e3b938433e59896fab0b19da8c..25a3edc34c28eef328e9c9c93fd6533e7206fc1f 100644
--- a/chrome/browser/ui/cocoa/styled_text_field_cell.mm
+++ b/chrome/browser/ui/cocoa/styled_text_field_cell.mm
@@ -16,7 +16,11 @@
@implementation StyledTextFieldCell
-- (CGFloat)baselineAdjust {
+- (CGFloat)topTextFrameOffset {
+ return 0.0;
+}
+
+- (CGFloat)bottomTextFrameOffset {
return 0.0;
}
@@ -32,16 +36,24 @@
return NO;
}
+- (NSRect)textFrameForFrameInternal:(NSRect)cellFrame {
+ CGFloat topOffset = [self topTextFrameOffset];
+ NSRect textFrame = cellFrame;
+ textFrame.origin.y += topOffset;
+ textFrame.size.height -= topOffset + [self bottomTextFrameOffset];
+ return textFrame;
+}
+
// Returns the same value as textCursorFrameForFrame, but does not call it
// directly to avoid potential infinite loops.
- (NSRect)textFrameForFrame:(NSRect)cellFrame {
- return NSInsetRect(cellFrame, 0, [self baselineAdjust]);
+ return [self textFrameForFrameInternal:cellFrame];
}
// Returns the same value as textFrameForFrame, but does not call it directly to
// avoid potential infinite loops.
- (NSRect)textCursorFrameForFrame:(NSRect)cellFrame {
- return NSInsetRect(cellFrame, 0, [self baselineAdjust]);
+ return [self textFrameForFrameInternal:cellFrame];
}
// Override to show the I-beam cursor only in the area given by
« no previous file with comments | « chrome/browser/ui/cocoa/styled_text_field_cell.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698