summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgroby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-14 21:54:35 +0000
committergroby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-14 21:54:35 +0000
commitd4c0ca6fff00aed010e339b612358fdd0b66dc69 (patch)
treec8861042ccc7090d28c19eb32a9d33a5151dedeb
parent5d6e9f6b22c9dfcb86d0c07408d4a5311c36e256 (diff)
downloadchromium_src-d4c0ca6fff00aed010e339b612358fdd0b66dc69.zip
chromium_src-d4c0ca6fff00aed010e339b612358fdd0b66dc69.tar.gz
chromium_src-d4c0ca6fff00aed010e339b612358fdd0b66dc69.tar.bz2
[rAC, OSX] Hide disabled fields without text.
requestAutocomplete should never display disabled fields that don't have a text value - those fields are not editable, and don't give any info to the user. BUG=325491 Review URL: https://codereview.chromium.org/199623002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257218 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/cocoa/autofill/autofill_textfield.mm12
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/browser/ui/cocoa/autofill/autofill_textfield.mm b/chrome/browser/ui/cocoa/autofill/autofill_textfield.mm
index d0e3ea5..af881de 100644
--- a/chrome/browser/ui/cocoa/autofill/autofill_textfield.mm
+++ b/chrome/browser/ui/cocoa/autofill/autofill_textfield.mm
@@ -215,10 +215,6 @@ const CGFloat kMinimumHeight = 27.0; // Enforced minimum height for text cells.
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView {
NSRect textFrame = [self textFrameForFrame:cellFrame];
[super drawInteriorWithFrame:textFrame inView:controlView];
-}
-
-- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView {
- [super drawWithFrame:cellFrame inView:controlView];
if (icon_) {
NSRect iconFrame = [self decorationFrameForFrame:cellFrame];
@@ -229,6 +225,14 @@ const CGFloat kMinimumHeight = 27.0; // Enforced minimum height for text cells.
respectFlipped:YES
hints:nil];
}
+}
+
+- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView {
+ // If the control is disabled and doesn't have text, don't draw it.
+ if (![self isEnabled] && ([[self stringValue] length] == 0))
+ return;
+
+ [super drawWithFrame:cellFrame inView:controlView];
if (invalid_) {
gfx::ScopedNSGraphicsContextSaveGState state;