From de1509c9e4b7322ef13b754acd4f500916b2e0f7 Mon Sep 17 00:00:00 2001 From: "rohitrao@chromium.org" Date: Fri, 6 Nov 2009 00:57:40 +0000 Subject: [Mac] Draw the results label correctly in the findbar. Adds common base classes (StyledTextField and StyledTextFieldCell) for both the find bar and omnibox text fields. BUG=http://crbug.com/19550 TEST=Findbar results label should not be overdrawn by find text. TEST=Autocomplete drawing (keyword, hint, lock icon) should not be affected. Review URL: http://codereview.chromium.org/319005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31186 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/cocoa/styled_text_field.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 chrome/browser/cocoa/styled_text_field.h (limited to 'chrome/browser/cocoa/styled_text_field.h') diff --git a/chrome/browser/cocoa/styled_text_field.h b/chrome/browser/cocoa/styled_text_field.h new file mode 100644 index 0000000..68a65b7 --- /dev/null +++ b/chrome/browser/cocoa/styled_text_field.h @@ -0,0 +1,29 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import + +@class StyledTextFieldCell; + +// An implementation of NSTextField that is designed to work with +// StyledTextFieldCell. Provides methods to redraw the field when cell +// decorations have changed and overrides |mouseDown:| to properly handle clicks +// in sections of the cell with decorations. +@interface StyledTextField : NSTextField { +} + +// Repositions and redraws the field editor. Call this method when the cell's +// text frame has changed (whenever changing cell decorations). +- (void)resetFieldEditorFrameIfNeeded; + +// Returns the amount of the field's width which is not being taken up +// by the text contents. May be negative if the contents are large +// enough to scroll. +- (CGFloat)availableDecorationWidth; + +@end + +@interface StyledTextField (ExposedForTesting) +- (StyledTextFieldCell*)styledTextFieldCell; +@end -- cgit v1.1