Chromium Code Reviews| 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..267774b96f3c01093b998181ed67ba6df355ef0f |
| --- /dev/null |
| +++ b/chrome/browser/ui/cocoa/autofill/autofill_dialog_window_controller.h |
| @@ -0,0 +1,103 @@ |
| +// 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 :)
|
| +// 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 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<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; |
| + |
| +// 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.
|
| +- (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 cancels dialog. |
|
Ilya Sherman
2013/11/14 23:30:04
nit: "cancels" -> "canceled"?
groby-ooo-7-16
2013/11/14 23:49:44
Done.
|
| +- (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; |
|
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.
|
| + |
| +@end |
| + |
| +#endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_WINDOW_CONTROLLER_H_ |