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/memory/scoped_nsobject.h" | 8 #include "base/memory/scoped_nsobject.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 10 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
11 #include "chrome/browser/ui/autofill/autofill_dialog_view.h" | 11 #include "chrome/browser/ui/autofill/autofill_dialog_view.h" |
| 12 #import "chrome/browser/ui/cocoa/autofill/autofill_layout.h" |
12 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" | 13 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" |
13 | 14 |
14 namespace content { | 15 namespace content { |
15 class NavigationController; | 16 class NavigationController; |
16 } | 17 } |
17 | 18 |
18 namespace autofill { | 19 namespace autofill { |
19 class AutofillDialogController; | 20 class AutofillDialogController; |
20 } | 21 } |
21 | 22 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 65 |
65 scoped_ptr<ConstrainedWindowMac> constrained_window_; | 66 scoped_ptr<ConstrainedWindowMac> constrained_window_; |
66 scoped_nsobject<AutofillDialogWindowController> sheet_controller_; | 67 scoped_nsobject<AutofillDialogWindowController> sheet_controller_; |
67 | 68 |
68 // The controller |this| queries for logic and state. | 69 // The controller |this| queries for logic and state. |
69 AutofillDialogController* controller_; | 70 AutofillDialogController* controller_; |
70 }; | 71 }; |
71 | 72 |
72 } // autofill | 73 } // autofill |
73 | 74 |
74 @interface AutofillDialogWindowController : NSWindowController | 75 @interface AutofillDialogWindowController : |
75 <NSWindowDelegate> { | 76 NSWindowController<NSWindowDelegate, AutofillLayout> { |
76 @private | 77 @private |
77 content::WebContents* webContents_; // weak. | 78 content::WebContents* webContents_; // weak. |
78 autofill::AutofillDialogCocoa* autofillDialog_; // weak. | 79 autofill::AutofillDialogCocoa* autofillDialog_; // weak. |
79 | 80 |
80 scoped_nsobject<AutofillMainContainer> mainContainer_; | 81 scoped_nsobject<AutofillMainContainer> mainContainer_; |
81 scoped_nsobject<AutofillSignInContainer> signInContainer_; | 82 scoped_nsobject<AutofillSignInContainer> signInContainer_; |
82 scoped_nsobject<AutofillAccountChooser> accountChooser_; | 83 scoped_nsobject<AutofillAccountChooser> accountChooser_; |
83 } | 84 } |
84 | 85 |
85 // Designated initializer. The WebContents cannot be NULL. | 86 // Designated initializer. The WebContents cannot be NULL. |
86 - (id)initWithWebContents:(content::WebContents*)webContents | 87 - (id)initWithWebContents:(content::WebContents*)webContents |
87 autofillDialog:(autofill::AutofillDialogCocoa*)autofillDialog; | 88 autofillDialog:(autofill::AutofillDialogCocoa*)autofillDialog; |
88 | 89 |
| 90 // A child view request re-layouting. |
| 91 - (void)requestRelayout; |
| 92 |
89 // Validate data. If it is valid, notify the controller that the user would | 93 // Validate data. If it is valid, notify the controller that the user would |
90 // like to use the data. | 94 // like to use the data. |
91 - (IBAction)accept:(id)sender; | 95 - (IBAction)accept:(id)sender; |
92 | 96 |
93 // User cancels dialog. | 97 // User cancels dialog. |
94 - (IBAction)cancel:(id)sender; | 98 - (IBAction)cancel:(id)sender; |
95 | 99 |
96 // Forwarding AutofillDialogView calls. | 100 // Forwarding AutofillDialogView calls. |
97 - (void)updateAccountChooser; | 101 - (void)updateAccountChooser; |
98 - (void)getInputs:(autofill::DetailOutputMap*)outputs | 102 - (void)getInputs:(autofill::DetailOutputMap*)outputs |
99 forSection:(autofill::DialogSection)section; | 103 forSection:(autofill::DialogSection)section; |
100 - (content::NavigationController*)showSignIn; | 104 - (content::NavigationController*)showSignIn; |
101 - (void)hideSignIn; | 105 - (void)hideSignIn; |
102 - (void)modelChanged; | 106 - (void)modelChanged; |
103 | 107 |
104 @end | 108 @end |
105 | 109 |
106 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_COCOA_H_ | 110 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_COCOA_H_ |
OLD | NEW |