| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_COCOA_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_COCOA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_COCOA_H_ |
| 7 | 7 |
| 8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 // WeakPtrFactory for deferred close. | 100 // WeakPtrFactory for deferred close. |
| 101 base::WeakPtrFactory<AutofillDialogCocoa> close_weak_ptr_factory_; | 101 base::WeakPtrFactory<AutofillDialogCocoa> close_weak_ptr_factory_; |
| 102 | 102 |
| 103 // The delegate |this| queries for logic and state. | 103 // The delegate |this| queries for logic and state. |
| 104 AutofillDialogViewDelegate* delegate_; | 104 AutofillDialogViewDelegate* delegate_; |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 } // autofill | 107 } // autofill |
| 108 | 108 |
| 109 @interface AutofillDialogWindowController : | |
| 110 NSWindowController<NSWindowDelegate, AutofillLayout> { | |
| 111 @private | |
| 112 content::WebContents* webContents_; // weak. | |
| 113 autofill::AutofillDialogCocoa* autofillDialog_; // weak. | |
| 114 | |
| 115 base::scoped_nsobject<AutofillMainContainer> mainContainer_; | |
| 116 base::scoped_nsobject<AutofillSignInContainer> signInContainer_; | |
| 117 base::scoped_nsobject<AutofillAccountChooser> accountChooser_; | |
| 118 base::scoped_nsobject<AutofillOverlayController> overlayController_; | |
| 119 base::scoped_nsobject<NSTextField> loadingShieldTextField_; | |
| 120 base::scoped_nsobject<NSTextField> titleTextField_; | |
| 121 base::scoped_nsobject<NSTextView> fieldEditor_; | |
| 122 } | |
| 123 | |
| 124 // Designated initializer. The WebContents cannot be NULL. | |
| 125 - (id)initWithWebContents:(content::WebContents*)webContents | |
| 126 autofillDialog:(autofill::AutofillDialogCocoa*)autofillDialog; | |
| 127 | |
| 128 // A child view request re-layouting. | |
| 129 - (void)requestRelayout; | |
| 130 | |
| 131 // Cancels all previous requests to re-layout. | |
| 132 - (void)cancelRelayout; | |
| 133 | |
| 134 // Validate data. If it is valid, notify the delegate that the user would | |
| 135 // like to use the data. | |
| 136 - (IBAction)accept:(id)sender; | |
| 137 | |
| 138 // User cancels dialog. | |
| 139 - (IBAction)cancel:(id)sender; | |
| 140 | |
| 141 // Forwarding AutofillDialogView calls. | |
| 142 - (void)show; | |
| 143 - (void)hide; | |
| 144 - (void)updateNotificationArea; | |
| 145 - (void)updateAccountChooser; | |
| 146 - (void)updateButtonStrip; | |
| 147 - (void)updateSection:(autofill::DialogSection)section; | |
| 148 - (void)fillSection:(autofill::DialogSection)section | |
| 149 forInput:(const autofill::DetailInput&)input; | |
| 150 - (void)getInputs:(autofill::DetailOutputMap*)outputs | |
| 151 forSection:(autofill::DialogSection)section; | |
| 152 - (NSString*)getCvc; | |
| 153 - (BOOL)saveDetailsLocally; | |
| 154 - (content::NavigationController*)showSignIn; | |
| 155 - (void)hideSignIn; | |
| 156 - (void)modelChanged; | |
| 157 - (void)updateErrorBubble; | |
| 158 - (void)onSignInResize:(NSSize)size; | |
| 159 | |
| 160 @end | |
| 161 | |
| 162 | |
| 163 // Mirrors the TestableAutofillDialogView API on the C++ side. | |
| 164 @interface AutofillDialogWindowController (TestableAutofillDialogView) | |
| 165 | |
| 166 - (void)setTextContents:(NSString*)text | |
| 167 forInput:(const autofill::DetailInput&)input; | |
| 168 - (void)setTextContents:(NSString*)text | |
| 169 ofSuggestionForSection:(autofill::DialogSection)section; | |
| 170 - (void)activateFieldForInput:(const autofill::DetailInput&)input; | |
| 171 - (content::WebContents*)getSignInWebContents; | |
| 172 - (BOOL)IsShowingOverlay; | |
| 173 | |
| 174 @end | |
| 175 | |
| 176 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_COCOA_H_ | 109 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_COCOA_H_ |
| OLD | NEW |