OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_MAC_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_MAC_ |
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_MAC_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_MAC_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #import "base/cocoa_protocols_mac.h" | 12 #import "base/cocoa_protocols_mac.h" |
13 #include "base/scoped_nsobject.h" | 13 #include "base/scoped_nsobject.h" |
14 #include "base/scoped_ptr.h" | 14 #include "base/scoped_ptr.h" |
15 #include "chrome/browser/autofill/autofill_dialog.h" | 15 #include "chrome/browser/autofill/autofill_dialog.h" |
16 #include "chrome/browser/autofill/autofill_profile.h" | 16 #include "chrome/browser/autofill/autofill_profile.h" |
17 #include "chrome/browser/autofill/credit_card.h" | 17 #include "chrome/browser/autofill/credit_card.h" |
| 18 #include "chrome/browser/pref_member.h" |
18 | 19 |
19 namespace AutoFillDialogControllerInternal { | 20 namespace AutoFillDialogControllerInternal { |
20 class PersonalDataManagerObserver; | 21 class PersonalDataManagerObserver; |
| 22 class PrefObserver; |
21 } // AutoFillDialogControllerInternal | 23 } // AutoFillDialogControllerInternal |
22 | 24 |
23 @class AutoFillAddressSheetController; | 25 @class AutoFillAddressSheetController; |
24 @class AutoFillCreditCardSheetController; | 26 @class AutoFillCreditCardSheetController; |
25 @class AutoFillTableView; | 27 @class AutoFillTableView; |
26 class Profile; | 28 class Profile; |
27 @class WindowSizeAutosaver; | 29 @class WindowSizeAutosaver; |
28 | 30 |
29 // A window controller for managing the autofill options dialog. | 31 // A window controller for managing the AutoFill options dialog. |
30 // Application modally presents a dialog allowing the user to store | 32 // Application modally presents a dialog allowing the user to store |
31 // personal address and credit card information. | 33 // personal address and credit card information. |
32 @interface AutoFillDialogController : NSWindowController <NSTableViewDelegate> { | 34 @interface AutoFillDialogController : NSWindowController <NSTableViewDelegate> { |
33 @private | 35 @private |
34 // Outlet to the main NSTableView object listing both addresses and credit | 36 // Outlet to the main NSTableView object listing both addresses and credit |
35 // cards with section headers for both. | 37 // cards with section headers for both. |
36 IBOutlet AutoFillTableView* tableView_; | 38 IBOutlet AutoFillTableView* tableView_; |
37 | 39 |
38 // Outlet to "Edit..." button. Here for unit testing purposes. | 40 // Outlet to "Edit..." button. Here for unit testing purposes. |
39 IBOutlet NSButton* editButton_; | 41 IBOutlet NSButton* editButton_; |
(...skipping 15 matching lines...) Expand all Loading... |
55 // Reference to input parameter. | 57 // Reference to input parameter. |
56 // Weak, not retained. | 58 // Weak, not retained. |
57 CreditCard* importedCreditCard_; | 59 CreditCard* importedCreditCard_; |
58 | 60 |
59 // Working list of input profiles. | 61 // Working list of input profiles. |
60 std::vector<AutoFillProfile> profiles_; | 62 std::vector<AutoFillProfile> profiles_; |
61 | 63 |
62 // Working list of input credit cards. | 64 // Working list of input credit cards. |
63 std::vector<CreditCard> creditCards_; | 65 std::vector<CreditCard> creditCards_; |
64 | 66 |
| 67 // Tracks the AutoFill enabled preference. |
| 68 BooleanPrefMember prefAutoFillEnabled_; |
| 69 |
65 // State of checkbox for enabling AutoFill in general. | 70 // State of checkbox for enabling AutoFill in general. |
66 BOOL autoFillEnabled_; | 71 BOOL autoFillEnabled_; |
67 | 72 |
| 73 // Whether AutoFill is controlled by configuration management. |
| 74 BOOL autoFillManaged_; |
| 75 |
| 76 // Whether AutoFill is managed and disabled. |
| 77 BOOL autoFillManagedAndDisabled_; |
| 78 |
68 // State of checkbox for enabling Mac Address Book integration. | 79 // State of checkbox for enabling Mac Address Book integration. |
69 BOOL auxiliaryEnabled_; | 80 BOOL auxiliaryEnabled_; |
70 | 81 |
71 // State for |itemIsSelected| property used in bindings for "Edit..." and | 82 // State for |itemIsSelected| property used in bindings for "Edit..." and |
72 // "Remove" buttons. | 83 // "Remove" buttons. |
73 BOOL itemIsSelected_; | 84 BOOL itemIsSelected_; |
74 | 85 |
75 // State for |multipleSelected| property used in bindings for "Edit..." | 86 // State for |multipleSelected| property used in bindings for "Edit..." |
76 // button. | 87 // button. |
77 BOOL multipleSelected_; | 88 BOOL multipleSelected_; |
78 | 89 |
79 // Utility object to save and restore dialog position. | 90 // Utility object to save and restore dialog position. |
80 scoped_nsobject<WindowSizeAutosaver> sizeSaver_; | 91 scoped_nsobject<WindowSizeAutosaver> sizeSaver_; |
81 | 92 |
82 // Transient reference to address "Add" / "Edit" sheet for address | 93 // Transient reference to address "Add" / "Edit" sheet for address |
83 // information. | 94 // information. |
84 scoped_nsobject<AutoFillAddressSheetController> addressSheetController; | 95 scoped_nsobject<AutoFillAddressSheetController> addressSheetController; |
85 | 96 |
86 // Transient reference to address "Add" / "Edit" sheet for credit card | 97 // Transient reference to address "Add" / "Edit" sheet for credit card |
87 // information. | 98 // information. |
88 scoped_nsobject<AutoFillCreditCardSheetController> creditCardSheetController; | 99 scoped_nsobject<AutoFillCreditCardSheetController> creditCardSheetController; |
89 | 100 |
90 // Manages PersonalDataManager loading. | 101 // Manages PersonalDataManager loading. |
91 scoped_ptr<AutoFillDialogControllerInternal::PersonalDataManagerObserver> | 102 scoped_ptr<AutoFillDialogControllerInternal::PersonalDataManagerObserver> |
92 personalDataManagerObserver_; | 103 personalDataManagerObserver_; |
| 104 |
| 105 // Watches for changes to the AutoFill enabled preference. |
| 106 scoped_ptr<AutoFillDialogControllerInternal::PrefObserver> prefObserver_; |
93 } | 107 } |
94 | 108 |
95 // Property representing state of the AutoFill enabled preference. Checkbox is | 109 // Property representing state of the AutoFill enabled preference. Checkbox is |
96 // bound to this in nib. Also, enabled state of other controls are also bound | 110 // bound to this in nib. Also, enabled state of other controls are also bound |
97 // to this property. | 111 // to this property. |
98 @property (nonatomic) BOOL autoFillEnabled; | 112 @property (nonatomic) BOOL autoFillEnabled; |
99 | 113 |
| 114 // Property indicating whether AutoFill is under control of configuration |
| 115 // management. The enabled state of the AutoFill enabled checkbox is bound to |
| 116 // this property. |
| 117 @property (nonatomic) BOOL autoFillManaged; |
| 118 |
| 119 // Property that is true iff AutoFill is managed and disabled. The save button's |
| 120 // enabled state is bound to this property. |
| 121 @property (nonatomic) BOOL autoFillManagedAndDisabled; |
| 122 |
100 // Property representing state of Address Book "me" card usage. Checkbox is | 123 // Property representing state of Address Book "me" card usage. Checkbox is |
101 // bound to this in nib. | 124 // bound to this in nib. |
102 @property (nonatomic) BOOL auxiliaryEnabled; | 125 @property (nonatomic) BOOL auxiliaryEnabled; |
103 | 126 |
104 // Property representing selection state in |tableView_|. Enabled state of | 127 // Property representing selection state in |tableView_|. Enabled state of |
105 // edit and delete buttons are bound to this property. | 128 // edit and delete buttons are bound to this property. |
106 @property (nonatomic) BOOL itemIsSelected; | 129 @property (nonatomic) BOOL itemIsSelected; |
107 | 130 |
108 // Property representing multiple selection state in |tableView_|. Enabled | 131 // Property representing multiple selection state in |tableView_|. Enabled |
109 // state of edit button is bound to this property. | 132 // state of edit button is bound to this property. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 - (AutoFillAddressSheetController*)addressSheetController; | 203 - (AutoFillAddressSheetController*)addressSheetController; |
181 - (AutoFillCreditCardSheetController*)creditCardSheetController; | 204 - (AutoFillCreditCardSheetController*)creditCardSheetController; |
182 - (void)selectAddressAtIndex:(size_t)i; | 205 - (void)selectAddressAtIndex:(size_t)i; |
183 - (void)selectCreditCardAtIndex:(size_t)i; | 206 - (void)selectCreditCardAtIndex:(size_t)i; |
184 - (void)addSelectedAddressAtIndex:(size_t)i; | 207 - (void)addSelectedAddressAtIndex:(size_t)i; |
185 - (void)addSelectedCreditCardAtIndex:(size_t)i; | 208 - (void)addSelectedCreditCardAtIndex:(size_t)i; |
186 - (BOOL)editButtonEnabled; | 209 - (BOOL)editButtonEnabled; |
187 @end | 210 @end |
188 | 211 |
189 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_MAC_ | 212 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_MAC_ |
OLD | NEW |