OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_WINDOW_CONTROLLER_H_ | |
6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_WINDOW_CONTROLLER_H_ | |
7 | |
8 #import <Cocoa/Cocoa.h> | |
9 | |
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" | |
14 | |
15 @class AutofillHeader; | |
16 @class AutofillMainContainer; | |
17 | |
18 class GURL; | |
19 | |
20 namespace content { | |
21 class NavigationController; | |
22 class WebContents; | |
23 } // content | |
24 | |
25 namespace autofill { | |
26 class AutofillDialogCocoa; | |
27 } // autofill | |
28 | |
29 // Forwarding AutofillDialogView calls. | |
30 @protocol AutofillDialogBridge | |
31 | |
32 - (void)show; | |
33 - (void)hide; | |
34 - (void)updateNotificationArea; | |
35 - (void)updateSection:(autofill::DialogSection)section; | |
36 - (void)updateForErrors; | |
37 - (void)fillSection:(autofill::DialogSection)section | |
38 forType:(const autofill::ServerFieldType)type; | |
39 - (void)getInputs:(autofill::FieldValueMap*)outputs | |
40 forSection:(autofill::DialogSection)section; | |
41 - (NSString*)getCvc; | |
42 - (BOOL)saveDetailsLocally; | |
43 - (void)modelChanged; | |
44 - (void)updateErrorBubble; | |
45 - (void)validateSection:(autofill::DialogSection)section; | |
46 | |
47 @end | |
48 | |
49 | |
50 // Window controller for AutofillDialogView. | |
51 @interface AutofillDialogWindowController : | |
52 NSWindowController<NSWindowDelegate, AutofillLayout, AutofillDialogBridge> { | |
53 @private | |
54 content::WebContents* webContents_; // weak. | |
55 autofill::AutofillDialogCocoa* dialog_; // weak. | |
56 | |
57 base::scoped_nsobject<AutofillHeader> header_; | |
58 base::scoped_nsobject<AutofillMainContainer> mainContainer_; | |
59 base::scoped_nsobject<NSTextView> fieldEditor_; | |
60 | |
61 // Signals the main container has recently become visible. | |
62 BOOL mainContainerBecameVisible_; | |
63 } | |
64 | |
65 // Designated initializer. The WebContents cannot be NULL. | |
66 - (id)initWithWebContents:(content::WebContents*)webContents | |
67 dialog:(autofill::AutofillDialogCocoa*)dialog; | |
68 | |
69 // Requests a re-layout for the entire dialog. The layout will be postponed | |
70 // until the next cycle of the runloop. | |
71 - (void)requestRelayout; | |
72 | |
73 // Validate data. If it is valid, notify the delegate that the user would | |
74 // like to use the data. | |
75 - (IBAction)accept:(id)sender; | |
76 | |
77 // User canceled the dialog. | |
78 - (IBAction)cancel:(id)sender; | |
79 | |
80 @end | |
81 | |
82 | |
83 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_WINDOW_CONTROLLER_H_ | |
OLD | NEW |