Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / cocoa / autofill / autofill_dialog_window_controller.h
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 AutofillHeader;
15 @class AutofillLoadingShieldController;
16 @class AutofillMainContainer;
17 @class AutofillOverlayController;
18 @class AutofillSignInContainer;
19
20 class GURL;
21
22 namespace content {
23 class NavigationController;
24 class WebContents;
25 }  // content
26
27 namespace autofill {
28 class AutofillDialogCocoa;
29 }  // autofill
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)updateForErrors;
41 - (void)fillSection:(autofill::DialogSection)section
42             forType:(const autofill::ServerFieldType)type;
43 - (void)getInputs:(autofill::FieldValueMap*)outputs
44        forSection:(autofill::DialogSection)section;
45 - (NSString*)getCvc;
46 - (BOOL)saveDetailsLocally;
47 - (content::NavigationController*)showSignIn:(const GURL&)url;
48 - (void)hideSignIn;
49 - (void)modelChanged;
50 - (void)updateErrorBubble;
51 - (void)onSignInResize:(NSSize)size;
52 - (void)validateSection:(autofill::DialogSection)section;
53
54 @end
55
56
57 // Window controller for AutofillDialogView.
58 @interface AutofillDialogWindowController :
59     NSWindowController<NSWindowDelegate, AutofillLayout, AutofillDialogBridge> {
60  @private
61   content::WebContents* webContents_;  // weak.
62   autofill::AutofillDialogCocoa* dialog_;  // weak.
63
64   base::scoped_nsobject<AutofillHeader> header_;
65   base::scoped_nsobject<AutofillMainContainer> mainContainer_;
66   base::scoped_nsobject<AutofillSignInContainer> signInContainer_;
67   base::scoped_nsobject<AutofillOverlayController> overlayController_;
68   base::scoped_nsobject<AutofillLoadingShieldController>
69       loadingShieldController_;
70   base::scoped_nsobject<NSTextView> fieldEditor_;
71
72   // Signals the main container has recently become visible.
73   BOOL mainContainerBecameVisible_;
74 }
75
76 // Designated initializer. The WebContents cannot be NULL.
77 - (id)initWithWebContents:(content::WebContents*)webContents
78                    dialog:(autofill::AutofillDialogCocoa*)dialog;
79
80 // Requests a re-layout for the entire dialog. The layout will be postponed
81 // until the next cycle of the runloop.
82 - (void)requestRelayout;
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 #endif  // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_WINDOW_CONTROLLER_H_