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 |
| 14 @class AutofillAccountChooser; |
| 15 @class AutofillDialogWindowController; |
| 16 @class AutofillLoadingShieldController; |
| 17 @class AutofillMainContainer; |
| 18 @class AutofillOverlayController; |
| 19 @class AutofillSignInContainer; |
| 20 |
| 21 namespace content { |
| 22 class NavigationController; |
| 23 class WebContents; |
| 24 } // content |
| 25 |
| 26 namespace autofill { |
| 27 class AutofillDialogCocoa; |
| 28 } // autofill |
| 29 |
| 30 |
| 31 // Forwarding AutofillDialogView calls. |
| 32 @protocol AutofillDialogBridge |
| 33 |
| 34 - (void)show; |
| 35 - (void)hide; |
| 36 - (void)updateNotificationArea; |
| 37 - (void)updateAccountChooser; |
| 38 - (void)updateButtonStrip; |
| 39 - (void)updateSection:(autofill::DialogSection)section; |
| 40 - (void)fillSection:(autofill::DialogSection)section |
| 41 forInput:(const autofill::DetailInput&)input; |
| 42 - (void)getInputs:(autofill::DetailOutputMap*)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; |
| 51 |
| 52 @end |
| 53 |
| 54 |
| 55 // Window controller for AutofillDialogView. |
| 56 @interface AutofillDialogWindowController : |
| 57 NSWindowController<NSWindowDelegate, AutofillLayout, AutofillDialogBridge> { |
| 58 @private |
| 59 content::WebContents* webContents_; // weak. |
| 60 autofill::AutofillDialogCocoa* autofillDialog_; // weak. |
| 61 |
| 62 base::scoped_nsobject<AutofillMainContainer> mainContainer_; |
| 63 base::scoped_nsobject<AutofillSignInContainer> signInContainer_; |
| 64 base::scoped_nsobject<AutofillAccountChooser> accountChooser_; |
| 65 base::scoped_nsobject<AutofillOverlayController> overlayController_; |
| 66 base::scoped_nsobject<AutofillLoadingShieldController> |
| 67 loadingShieldController_; |
| 68 base::scoped_nsobject<NSTextField> loadingShieldTextField_; |
| 69 base::scoped_nsobject<NSTextField> titleTextField_; |
| 70 base::scoped_nsobject<NSTextView> fieldEditor_; |
| 71 } |
| 72 |
| 73 // Designated initializer. The WebContents cannot be NULL. |
| 74 - (id)initWithWebContents:(content::WebContents*)webContents |
| 75 autofillDialog:(autofill::AutofillDialogCocoa*)autofillDialog; |
| 76 |
| 77 // Requests a re-layout for the entire dialog. The layout will be postponed |
| 78 // until the next cycle of the runloop. |
| 79 - (void)requestRelayout; |
| 80 |
| 81 // Cancels all previous requests to re-layout. |
| 82 - (void)cancelRelayout; |
| 83 |
| 84 // Validate data. If it is valid, notify the delegate that the user would |
| 85 // like to use the data. |
| 86 - (IBAction)accept:(id)sender; |
| 87 |
| 88 // User canceled the dialog. |
| 89 - (IBAction)cancel:(id)sender; |
| 90 |
| 91 @end |
| 92 |
| 93 |
| 94 // Mirrors the TestableAutofillDialogView API on the C++ side. |
| 95 @interface AutofillDialogWindowController (TestableAutofillDialogView) |
| 96 |
| 97 - (void)setTextContents:(NSString*)text |
| 98 forInput:(const autofill::DetailInput&)input; |
| 99 - (void)setTextContents:(NSString*)text |
| 100 ofSuggestionForSection:(autofill::DialogSection)section; |
| 101 - (void)activateFieldForInput:(const autofill::DetailInput&)input; |
| 102 - (content::WebContents*)getSignInWebContents; |
| 103 - (BOOL)isShowingOverlay; |
| 104 |
| 105 @end |
| 106 |
| 107 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_WINDOW_CONTROLLER_H_ |
OLD | NEW |