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
;
24 class NavigationController
;
29 class AutofillDialogCocoa
;
32 // Forwarding AutofillDialogView calls.
33 @protocol AutofillDialogBridge
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
;
47 - (BOOL
)saveDetailsLocally
;
48 - (content::NavigationController
*)showSignIn
:(const GURL
&)url
;
51 - (void)updateErrorBubble
;
52 - (void)onSignInResize
:(NSSize
)size
;
53 - (void)validateSection
:(autofill::DialogSection
)section
;
58 // Window controller for AutofillDialogView.
59 @interface AutofillDialogWindowController
:
60 NSWindowController
<NSWindowDelegate
, AutofillLayout
, AutofillDialogBridge
> {
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
;
95 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_WINDOW_CONTROLLER_H_