Index: chrome/browser/ui/cocoa/autofill/autofill_dialog_window_controller.h |
diff --git a/chrome/browser/ui/cocoa/autofill/autofill_dialog_window_controller.h b/chrome/browser/ui/cocoa/autofill/autofill_dialog_window_controller.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f94d0a821b6b9733bf409f6bb530d03ce32acce3 |
--- /dev/null |
+++ b/chrome/browser/ui/cocoa/autofill/autofill_dialog_window_controller.h |
@@ -0,0 +1,107 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_WINDOW_CONTROLLER_H_ |
+#define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_WINDOW_CONTROLLER_H_ |
+ |
+#import <Cocoa/Cocoa.h> |
+ |
+#include "base/mac/scoped_nsobject.h" |
+#include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
+#import "chrome/browser/ui/cocoa/autofill/autofill_layout.h" |
+ |
+@class AutofillAccountChooser; |
+@class AutofillDialogWindowController; |
+@class AutofillLoadingShieldController; |
+@class AutofillMainContainer; |
+@class AutofillOverlayController; |
+@class AutofillSignInContainer; |
+ |
+namespace content { |
+class NavigationController; |
+class WebContents; |
+} // content |
+ |
+namespace autofill { |
+class AutofillDialogCocoa; |
+} // autofill |
+ |
+ |
+// Forwarding AutofillDialogView calls. |
+@protocol AutofillDialogBridge |
+ |
+- (void)show; |
+- (void)hide; |
+- (void)updateNotificationArea; |
+- (void)updateAccountChooser; |
+- (void)updateButtonStrip; |
+- (void)updateSection:(autofill::DialogSection)section; |
+- (void)fillSection:(autofill::DialogSection)section |
+ forInput:(const autofill::DetailInput&)input; |
+- (void)getInputs:(autofill::DetailOutputMap*)outputs |
+ forSection:(autofill::DialogSection)section; |
+- (NSString*)getCvc; |
+- (BOOL)saveDetailsLocally; |
+- (content::NavigationController*)showSignIn; |
+- (void)hideSignIn; |
+- (void)modelChanged; |
+- (void)updateErrorBubble; |
+- (void)onSignInResize:(NSSize)size; |
+ |
+@end |
+ |
+ |
+// Window controller for AutofillDialogView. |
+@interface AutofillDialogWindowController : |
+ NSWindowController<NSWindowDelegate, AutofillLayout, AutofillDialogBridge> { |
+ @private |
+ content::WebContents* webContents_; // weak. |
+ autofill::AutofillDialogCocoa* autofillDialog_; // weak. |
+ |
+ base::scoped_nsobject<AutofillMainContainer> mainContainer_; |
+ base::scoped_nsobject<AutofillSignInContainer> signInContainer_; |
+ base::scoped_nsobject<AutofillAccountChooser> accountChooser_; |
+ base::scoped_nsobject<AutofillOverlayController> overlayController_; |
+ base::scoped_nsobject<AutofillLoadingShieldController> |
+ loadingShieldController_; |
+ base::scoped_nsobject<NSTextField> loadingShieldTextField_; |
+ base::scoped_nsobject<NSTextField> titleTextField_; |
+ base::scoped_nsobject<NSTextView> fieldEditor_; |
+} |
+ |
+// Designated initializer. The WebContents cannot be NULL. |
+- (id)initWithWebContents:(content::WebContents*)webContents |
+ autofillDialog:(autofill::AutofillDialogCocoa*)autofillDialog; |
+ |
+// Requests a re-layout for the entire dialog. The layout will be postponed |
+// until the next cycle of the runloop. |
+- (void)requestRelayout; |
+ |
+// Cancels all previous requests to re-layout. |
+- (void)cancelRelayout; |
+ |
+// Validate data. If it is valid, notify the delegate that the user would |
+// like to use the data. |
+- (IBAction)accept:(id)sender; |
+ |
+// User canceled the dialog. |
+- (IBAction)cancel:(id)sender; |
+ |
+@end |
+ |
+ |
+// Mirrors the TestableAutofillDialogView API on the C++ side. |
+@interface AutofillDialogWindowController (TestableAutofillDialogView) |
+ |
+- (void)setTextContents:(NSString*)text |
+ forInput:(const autofill::DetailInput&)input; |
+- (void)setTextContents:(NSString*)text |
+ ofSuggestionForSection:(autofill::DialogSection)section; |
+- (void)activateFieldForInput:(const autofill::DetailInput&)input; |
+- (content::WebContents*)getSignInWebContents; |
+- (BOOL)isShowingOverlay; |
+ |
+@end |
+ |
+#endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_WINDOW_CONTROLLER_H_ |