NaCl: Update revision in DEPS, r12770 -> r12773
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / autofill / autofill_notification_controller.h
blob86bda584523edfdcb711afce8c49e8a9f9409e43
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_NOTIFICATION_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_NOTIFICATION_CONTROLLER_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/mac/scoped_nsobject.h"
11 #include "chrome/browser/ui/autofill/autofill_dialog_types.h"
12 #import "chrome/browser/ui/cocoa/autofill/autofill_layout.h"
13 #include "url/gurl.h"
15 @class AutofillTooltipController;
16 @class HyperlinkTextView;
18 namespace autofill {
19 class AutofillDialogViewDelegate;
22 // Contains a single notification for requestAutocomplete dialog.
23 @interface AutofillNotificationController :
24 NSViewController<AutofillLayout, NSTextViewDelegate> {
25 @private
26 // Text view for label.
27 base::scoped_nsobject<HyperlinkTextView> textview_;
29 // Optional checkbox.
30 base::scoped_nsobject<NSButton> checkbox_;
32 // Optional tooltip icon.
33 base::scoped_nsobject<AutofillTooltipController> tooltipController_;
35 // Optional link target.
36 GURL linkURL_;
38 // Notification type.
39 autofill::DialogNotification::Type notificationType_;
41 // Main delegate for the dialog. Weak, owns dialog.
42 autofill::AutofillDialogViewDelegate* delegate_;
45 @property(nonatomic, readonly) NSTextView* textview;
46 @property(nonatomic, readonly) NSButton* checkbox;
47 @property(nonatomic, readonly) NSView* tooltipView;
49 // Designated initializer. Initializes the controller as specified by
50 // |notification|.
51 - (id)initWithNotification:(const autofill::DialogNotification*)notification
52 delegate:(autofill::AutofillDialogViewDelegate*)delegate;
54 // Displays arrow on top of notification if set to YES. |anchorView| determines
55 // the arrow position - the tip of the arrow is centered on the horizontal
56 // midpoint of the anchorView.
57 - (void)setHasArrow:(BOOL)hasArrow withAnchorView:(NSView*)anchorView;
59 // Indicates if the controller draws an arrow.
60 - (BOOL)hasArrow;
62 // Compute preferred size for given width.
63 - (NSSize)preferredSizeForWidth:(CGFloat)width;
65 - (IBAction)checkboxClicked:(id)sender;
67 @end
69 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_NOTIFICATION_CONTROLLER_H_