BookmarkManager: Fix 'new folder text field size changes on clicking it' issue.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / autofill / autofill_suggestion_container.h
blob0d964a178c190a5e4b8a836c63527a8ace6a35a2
1 // Copyright 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_SUGGESTION_CONTAINER_H_
6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_SUGGESTION_CONTAINER_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/mac/scoped_nsobject.h"
11 #import "chrome/browser/ui/cocoa/autofill/autofill_layout.h"
13 namespace autofill {
14 class AutofillDialogViewDelegate;
17 @class AutofillTextField;
19 // Container for the data suggested for a particular input section.
20 @interface AutofillSuggestionContainer : NSViewController<AutofillLayout> {
21 @private
22 // The spacer at the top of the suggestion.
23 base::scoped_nsobject<NSBox> spacer_;
25 // The label that holds the suggestion description text.
26 base::scoped_nsobject<NSTextView> label_;
28 // The input set by ShowTextfield.
29 base::scoped_nsobject<AutofillTextField> inputField_;
31 autofill::AutofillDialogViewDelegate* delegate_; // Not owned.
34 // Auxiliary textfield. See showInputField: for details.
35 @property (readonly, nonatomic) AutofillTextField* inputField;
37 // Set the main suggestion text and the corresponding |icon|. The text is set to
38 // |verticallyCompactText| if that can fit without wrapping. Otherwise, the text
39 // is set to |horizontallyCompactText|, with possibly additional wrapping
40 // imposed by the dialog's size constraints.
41 // NOTE: The implementation assumes that all other elements' sizes are already
42 // known. Hence, -showInputField:withIcon: should be called prior to calling
43 // this method, if it is going to be called at all.
44 - (void)
45 setSuggestionWithVerticallyCompactText:(NSString*)verticallyCompactText
46 horizontallyCompactText:(NSString*)horizontallyCompactText
47 icon:(NSImage*)icon
48 maxWidth:(CGFloat)maxWidth;
50 // Shows an auxiliary textfield to the right of the suggestion icon and
51 // text. This is currently only used to show a CVC field for the CC section.
52 - (void)showInputField:(NSString*)text withIcon:(NSImage*)icon;
54 @end
56 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_SUGGESTION_CONTAINER_H_