Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / autofill / autofill_textfield.h
blob1c9aba6a54879a42ca86796b30d223a0817ace76
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_TEXTFIELD_H_
6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_TEXTFIELD_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/mac/scoped_nsobject.h"
11 #include "chrome/browser/ui/cocoa/autofill/autofill_input_field.h"
13 // Text field used for text inputs inside Autofill.
14 // Provides a red outline when the contents are marked invalid.
15 @interface AutofillTextField : NSTextField<AutofillInputField,
16 NSTextFieldDelegate> {
17 @private
18 id<AutofillInputDelegate> inputDelegate_;
19 base::scoped_nsobject<NSString> validityMessage_;
21 // |shouldFilterFirstClick_| ensures only the very first click after
22 // -becomeFirstResponder: is treated specially.
23 BOOL shouldFilterClick_;
25 // YES if the field is currently handling a click that caused the field to
26 // become first responder.
27 BOOL handlingFirstClick_;
29 // YES if the field allows input of multiple lines of text.
30 BOOL isMultiline_;
33 @property(nonatomic, assign) BOOL isMultiline;
35 // Can be invoked by field editor to forward mouseDown messages from the field
36 // editor to the AutofillTextField.
37 - (void)onEditorMouseDown:(id)sender;
39 // Returns the frame reserved for the decoration set on the cell.
40 - (NSRect)decorationFrame;
42 @end
44 @interface AutofillTextFieldCell : NSTextFieldCell<AutofillInputCell> {
45 @private
46 BOOL invalid_;
47 NSString* defaultValue_;
48 base::scoped_nsobject<NSImage> icon_;
50 // The size of the decoration for the field. This is most commonly the
51 // |icon_|'s size, but can also be used to reserve space for a decoration that
52 // is not drawn by this cell.
53 NSSize decorationSize_;
56 @property(nonatomic, retain) NSImage* icon;
57 @property(nonatomic, assign) NSSize decorationSize;
59 // Returns the frame reserved for a decoration of size |decorationSize|.
60 - (NSRect)decorationFrameForFrame:(NSRect)frame;
62 @end
64 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_TEXTFIELD_H_