OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 class FormGroup; | 33 class FormGroup; |
34 class Profile; | 34 class Profile; |
35 | 35 |
36 namespace content { | 36 namespace content { |
37 class WebContents; | 37 class WebContents; |
38 } | 38 } |
39 | 39 |
40 namespace autofill { | 40 namespace autofill { |
41 | 41 |
42 class AutofillDialogView; | 42 class AutofillDialogView; |
| 43 class DataModelWrapper; |
43 | 44 |
44 // This class drives the dialog that appears when a site uses the imperative | 45 // This class drives the dialog that appears when a site uses the imperative |
45 // autocomplete API to fill out a form. | 46 // autocomplete API to fill out a form. |
46 class AutofillDialogControllerImpl : public AutofillDialogController, | 47 class AutofillDialogControllerImpl : public AutofillDialogController, |
47 public AutofillPopupDelegate, | 48 public AutofillPopupDelegate, |
48 public content::NotificationObserver, | 49 public content::NotificationObserver, |
49 public SuggestionsMenuModelDelegate, | 50 public SuggestionsMenuModelDelegate, |
50 public wallet::WalletClientObserver, | 51 public wallet::WalletClientObserver, |
51 public PersonalDataManagerObserver { | 52 public PersonalDataManagerObserver { |
52 public: | 53 public: |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 bool HasRequiredAction(wallet::RequiredAction action) const; | 175 bool HasRequiredAction(wallet::RequiredAction action) const; |
175 | 176 |
176 // Initializes |suggested_email_| et al. | 177 // Initializes |suggested_email_| et al. |
177 void GenerateSuggestionsModels(); | 178 void GenerateSuggestionsModels(); |
178 | 179 |
179 // Returns whether |profile| is complete, i.e. can fill out all the relevant | 180 // Returns whether |profile| is complete, i.e. can fill out all the relevant |
180 // address info. Incomplete profiles will not be displayed in the dropdown | 181 // address info. Incomplete profiles will not be displayed in the dropdown |
181 // menu. | 182 // menu. |
182 bool IsCompleteProfile(const AutofillProfile& profile); | 183 bool IsCompleteProfile(const AutofillProfile& profile); |
183 | 184 |
| 185 // Creates a DataModelWrapper item for the item that's checked in the |
| 186 // suggestion model for |section|. This may represent Autofill |
| 187 // data or Wallet data, depending on whether Wallet is currently enabled. |
| 188 DataModelWrapper* CreateWrapper(DialogSection section); |
| 189 |
184 // Fills in |section|-related fields in |output_| according to the state of | 190 // Fills in |section|-related fields in |output_| according to the state of |
185 // |view_|. | 191 // |view_|. |
186 void FillOutputForSection(DialogSection section); | 192 void FillOutputForSection(DialogSection section); |
187 // As above, but uses |compare| to determine whether a DetailInput matches | 193 // As above, but uses |compare| to determine whether a DetailInput matches |
188 // a field. | 194 // a field. |
189 void FillOutputForSectionWithComparator(DialogSection section, | 195 void FillOutputForSectionWithComparator(DialogSection section, |
190 const InputFieldComparator& compare); | 196 const InputFieldComparator& compare); |
191 | 197 |
192 // Fills in |form_structure_| using |form_group|. Utility method for | 198 // Fills in |form_structure_| using |form_group|. Utility method for |
193 // FillOutputForSection. | 199 // FillOutputForSection. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 301 |
296 // A NotificationRegistrar for tracking the completion of sign-in. | 302 // A NotificationRegistrar for tracking the completion of sign-in. |
297 content::NotificationRegistrar registrar_; | 303 content::NotificationRegistrar registrar_; |
298 | 304 |
299 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 305 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
300 }; | 306 }; |
301 | 307 |
302 } // namespace autofill | 308 } // namespace autofill |
303 | 309 |
304 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 310 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
OLD | NEW |