OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
Ilya Sherman
2013/11/14 23:30:04
ultra nit: Please omit the "(c)"
groby-ooo-7-16
2013/11/14 23:49:44
Sure can do - it was a simple copy/pasta :)
| |
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 | |
14 @class AutofillAccountChooser; | |
15 @class AutofillDialogWindowController; | |
16 @class AutofillMainContainer; | |
17 @class AutofillOverlayController; | |
18 @class AutofillSignInContainer; | |
19 | |
20 namespace content { | |
21 class NavigationController; | |
22 class WebContents; | |
23 } // content | |
24 | |
25 namespace autofill { | |
26 class AutofillDialogCocoa; | |
27 } // autofill | |
28 | |
29 | |
30 // Forwarding AutofillDialogView calls. | |
31 @protocol AutofillDialogBridge | |
32 | |
33 - (void)show; | |
34 - (void)hide; | |
35 - (void)updateNotificationArea; | |
36 - (void)updateAccountChooser; | |
37 - (void)updateButtonStrip; | |
38 - (void)updateSection:(autofill::DialogSection)section; | |
39 - (void)fillSection:(autofill::DialogSection)section | |
40 forInput:(const autofill::DetailInput&)input; | |
41 - (void)getInputs:(autofill::DetailOutputMap*)outputs | |
42 forSection:(autofill::DialogSection)section; | |
43 - (NSString*)getCvc; | |
44 - (BOOL)saveDetailsLocally; | |
45 - (content::NavigationController*)showSignIn; | |
46 - (void)hideSignIn; | |
47 - (void)modelChanged; | |
48 - (void)updateErrorBubble; | |
49 - (void)onSignInResize:(NSSize)size; | |
50 | |
51 @end | |
52 | |
53 | |
54 // Window controller for AutofillDialogView. | |
55 @interface AutofillDialogWindowController : | |
56 NSWindowController<NSWindowDelegate, AutofillLayout, AutofillDialogBridge> { | |
57 @private | |
58 content::WebContents* webContents_; // weak. | |
59 autofill::AutofillDialogCocoa* autofillDialog_; // weak. | |
60 | |
61 base::scoped_nsobject<AutofillMainContainer> mainContainer_; | |
62 base::scoped_nsobject<AutofillSignInContainer> signInContainer_; | |
63 base::scoped_nsobject<AutofillAccountChooser> accountChooser_; | |
64 base::scoped_nsobject<AutofillOverlayController> overlayController_; | |
65 base::scoped_nsobject<NSTextField> loadingShieldTextField_; | |
66 base::scoped_nsobject<NSTextField> titleTextField_; | |
67 base::scoped_nsobject<NSTextView> fieldEditor_; | |
68 } | |
69 | |
70 // Designated initializer. The WebContents cannot be NULL. | |
71 - (id)initWithWebContents:(content::WebContents*)webContents | |
72 autofillDialog:(autofill::AutofillDialogCocoa*)autofillDialog; | |
73 | |
74 // A child view request re-layouting. | |
Ilya Sherman
2013/11/14 23:30:04
nit: This is currently a sentence fragment; please
groby-ooo-7-16
2013/11/14 23:49:44
Done.
| |
75 - (void)requestRelayout; | |
76 | |
77 // Cancels all previous requests to re-layout. | |
78 - (void)cancelRelayout; | |
79 | |
80 // Validate data. If it is valid, notify the delegate that the user would | |
81 // like to use the data. | |
82 - (IBAction)accept:(id)sender; | |
83 | |
84 // User cancels dialog. | |
Ilya Sherman
2013/11/14 23:30:04
nit: "cancels" -> "canceled"?
groby-ooo-7-16
2013/11/14 23:49:44
Done.
| |
85 - (IBAction)cancel:(id)sender; | |
86 | |
87 @end | |
88 | |
89 | |
90 // Mirrors the TestableAutofillDialogView API on the C++ side. | |
91 @interface AutofillDialogWindowController (TestableAutofillDialogView) | |
92 | |
93 - (void)setTextContents:(NSString*)text | |
94 forInput:(const autofill::DetailInput&)input; | |
95 - (void)setTextContents:(NSString*)text | |
96 ofSuggestionForSection:(autofill::DialogSection)section; | |
97 - (void)activateFieldForInput:(const autofill::DetailInput&)input; | |
98 - (content::WebContents*)getSignInWebContents; | |
99 - (BOOL)IsShowingOverlay; | |
Ilya Sherman
2013/11/14 23:30:04
nit: Why is the first letter capitalized?
groby-ooo-7-16
2013/11/14 23:49:44
Done.
| |
100 | |
101 @end | |
102 | |
103 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_WINDOW_CONTROLLER_H_ | |
OLD | NEW |