[Extensions] Make extension message bubble factory platform-abstract
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / autofill / autofill_dialog_window_controller.h
blobb5efdcec1b9f5f0358b6857e598032213faf551a
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_DIALOG_WINDOW_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_WINDOW_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 "components/autofill/core/browser/dialog_section.h"
15 @class AutofillHeader;
16 @class AutofillLoadingShieldController;
17 @class AutofillMainContainer;
18 @class AutofillOverlayController;
19 @class AutofillSignInContainer;
21 class GURL;
23 namespace content {
24 class NavigationController;
25 class WebContents;
26 } // content
28 namespace autofill {
29 class AutofillDialogCocoa;
30 } // autofill
32 // Forwarding AutofillDialogView calls.
33 @protocol AutofillDialogBridge
35 - (void)show;
36 - (void)hide;
37 - (void)updateNotificationArea;
38 - (void)updateAccountChooser;
39 - (void)updateButtonStrip;
40 - (void)updateSection:(autofill::DialogSection)section;
41 - (void)updateForErrors;
42 - (void)fillSection:(autofill::DialogSection)section
43 forType:(const autofill::ServerFieldType)type;
44 - (void)getInputs:(autofill::FieldValueMap*)outputs
45 forSection:(autofill::DialogSection)section;
46 - (NSString*)getCvc;
47 - (BOOL)saveDetailsLocally;
48 - (content::NavigationController*)showSignIn:(const GURL&)url;
49 - (void)hideSignIn;
50 - (void)modelChanged;
51 - (void)updateErrorBubble;
52 - (void)onSignInResize:(NSSize)size;
53 - (void)validateSection:(autofill::DialogSection)section;
55 @end
58 // Window controller for AutofillDialogView.
59 @interface AutofillDialogWindowController :
60 NSWindowController<NSWindowDelegate, AutofillLayout, AutofillDialogBridge> {
61 @private
62 content::WebContents* webContents_; // weak.
63 autofill::AutofillDialogCocoa* dialog_; // weak.
65 base::scoped_nsobject<AutofillHeader> header_;
66 base::scoped_nsobject<AutofillMainContainer> mainContainer_;
67 base::scoped_nsobject<AutofillSignInContainer> signInContainer_;
68 base::scoped_nsobject<AutofillOverlayController> overlayController_;
69 base::scoped_nsobject<AutofillLoadingShieldController>
70 loadingShieldController_;
71 base::scoped_nsobject<NSTextView> fieldEditor_;
73 // Signals the main container has recently become visible.
74 BOOL mainContainerBecameVisible_;
77 // Designated initializer. The WebContents cannot be NULL.
78 - (id)initWithWebContents:(content::WebContents*)webContents
79 dialog:(autofill::AutofillDialogCocoa*)dialog;
81 // Requests a re-layout for the entire dialog. The layout will be postponed
82 // until the next cycle of the runloop.
83 - (void)requestRelayout;
85 // Validate data. If it is valid, notify the delegate that the user would
86 // like to use the data.
87 - (IBAction)accept:(id)sender;
89 // User canceled the dialog.
90 - (IBAction)cancel:(id)sender;
92 @end
95 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_WINDOW_CONTROLLER_H_