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"
14 @
class AutofillHeader
;
15 @
class AutofillLoadingShieldController
;
16 @
class AutofillMainContainer
;
17 @
class AutofillOverlayController
;
18 @
class AutofillSignInContainer
;
21 class NavigationController
;
26 class AutofillDialogCocoa
;
30 // Forwarding AutofillDialogView calls.
31 @protocol AutofillDialogBridge
35 - (void)updateNotificationArea
;
36 - (void)updateAccountChooser
;
37 - (void)updateButtonStrip
;
38 - (void)updateSection
:(autofill::DialogSection
)section
;
39 - (void)updateForErrors
;
40 - (void)fillSection
:(autofill::DialogSection
)section
41 forType
:(const autofill::ServerFieldType
)type
;
42 - (void)getInputs
:(autofill::FieldValueMap
*)outputs
43 forSection
:(autofill::DialogSection
)section
;
45 - (BOOL
)saveDetailsLocally
;
46 - (content::NavigationController
*)showSignIn
;
49 - (void)updateErrorBubble
;
50 - (void)onSignInResize
:(NSSize
)size
;
51 - (void)validateSection
:(autofill::DialogSection
)section
;
56 // Window controller for AutofillDialogView.
57 @interface AutofillDialogWindowController
:
58 NSWindowController
<NSWindowDelegate
, AutofillLayout
, AutofillDialogBridge
> {
60 content::WebContents
* webContents_
; // weak.
61 autofill::AutofillDialogCocoa
* dialog_
; // weak.
63 base::scoped_nsobject
<AutofillHeader
> header_
;
64 base::scoped_nsobject
<AutofillMainContainer
> mainContainer_
;
65 base::scoped_nsobject
<AutofillSignInContainer
> signInContainer_
;
66 base::scoped_nsobject
<AutofillOverlayController
> overlayController_
;
67 base::scoped_nsobject
<AutofillLoadingShieldController
>
68 loadingShieldController_
;
69 base::scoped_nsobject
<NSTextView
> fieldEditor_
;
71 // Signals the main container has recently become visible.
72 BOOL mainContainerBecameVisible_
;
75 // Designated initializer. The WebContents cannot be NULL.
76 - (id
)initWithWebContents
:(content::WebContents
*)webContents
77 dialog
:(autofill::AutofillDialogCocoa
*)dialog
;
79 // Requests a re-layout for the entire dialog. The layout will be postponed
80 // until the next cycle of the runloop.
81 - (void)requestRelayout
;
83 // Validate data. If it is valid, notify the delegate that the user would
84 // like to use the data.
85 - (IBAction
)accept
:(id
)sender
;
87 // User canceled the dialog.
88 - (IBAction
)cancel
:(id
)sender
;
93 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_WINDOW_CONTROLLER_H_