Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / autofill / autofill_dialog_window_controller.h
blobee94e076cb8c013899fe3b96555d8fc7d0da99f8
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;
20 namespace content {
21 class NavigationController;
22 class WebContents;
23 } // content
25 namespace autofill {
26 class AutofillDialogCocoa;
27 } // autofill
30 // Forwarding AutofillDialogView calls.
31 @protocol AutofillDialogBridge
33 - (void)show;
34 - (void)hide;
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;
44 - (NSString*)getCvc;
45 - (BOOL)saveDetailsLocally;
46 - (content::NavigationController*)showSignIn;
47 - (void)hideSignIn;
48 - (void)modelChanged;
49 - (void)updateErrorBubble;
50 - (void)onSignInResize:(NSSize)size;
52 @end
55 // Window controller for AutofillDialogView.
56 @interface AutofillDialogWindowController :
57 NSWindowController<NSWindowDelegate, AutofillLayout, AutofillDialogBridge> {
58 @private
59 content::WebContents* webContents_; // weak.
60 autofill::AutofillDialogCocoa* dialog_; // weak.
62 base::scoped_nsobject<AutofillHeader> header_;
63 base::scoped_nsobject<AutofillMainContainer> mainContainer_;
64 base::scoped_nsobject<AutofillSignInContainer> signInContainer_;
65 base::scoped_nsobject<AutofillOverlayController> overlayController_;
66 base::scoped_nsobject<AutofillLoadingShieldController>
67 loadingShieldController_;
68 base::scoped_nsobject<NSTextView> fieldEditor_;
70 // Signals the main container has recently become visible.
71 BOOL mainContainerBecameVisible_;
74 // Designated initializer. The WebContents cannot be NULL.
75 - (id)initWithWebContents:(content::WebContents*)webContents
76 dialog:(autofill::AutofillDialogCocoa*)dialog;
78 // Requests a re-layout for the entire dialog. The layout will be postponed
79 // until the next cycle of the runloop.
80 - (void)requestRelayout;
82 // Validate data. If it is valid, notify the delegate that the user would
83 // like to use the data.
84 - (IBAction)accept:(id)sender;
86 // User canceled the dialog.
87 - (IBAction)cancel:(id)sender;
89 @end
92 // Mirrors the TestableAutofillDialogView API on the C++ side.
93 @interface AutofillDialogWindowController (TestableAutofillDialogView)
95 - (void)setTextContents:(NSString*)text
96 forType:(autofill::ServerFieldType)type;
97 - (void)setTextContents:(NSString*)text
98 ofSuggestionForSection:(autofill::DialogSection)section;
99 - (void)activateFieldForType:(autofill::ServerFieldType)type;
100 - (content::WebContents*)getSignInWebContents;
101 - (BOOL)isShowingOverlay;
103 @end
105 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_WINDOW_CONTROLLER_H_